| Server IP : 54.36.91.62 / Your IP : 216.73.217.112 Web Server : Apache System : Linux webm013.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : coopiak ( 151928) PHP Version : 8.3.23 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/coopiak/amisdesseniors-fr/lemans/plugins/system/aimycanonical/helpers/ |
Upload File : |
<?php
/*
* Copyright (c) 2024-2025 Aimy Extensions, Netzum Sorglos Software GmbH
*
* https://www.aimy-extensions.com/
*
* License: GNU GPLv2, see LICENSE.txt within distribution and/or
* http://www.aimy-extensions.com/software-license.html
*/
namespace AimyCanonical\Helpers; \defined( '_JEXEC' ) or die(); use Joomla\CMS\Factory; class RedirectLoopChecker { const SESSION_KEY = 'AimyCanonical.last-redirect'; const THRESHOLD = 5; private $ses = false; public function __construct() { $this->ses = Factory::getApplication()->getSession(); } public function storeRedirect( $url ) { $o = new \StdClass(); $o->url = $url; $o->stamp = \time(); $this->ses->set( self::SESSION_KEY, $o ); } public function wouldBeLoop( $url ) { if ( $lastUrl = $this->ses->get( self::SESSION_KEY, false ) ) { if ( \is_object( $lastUrl ) && $lastUrl->url === $url ) { return ( time() - $lastUrl->stamp ) < self::THRESHOLD; } } return false; } }