mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-12 01:54:26 +02:00
Remove $_SERVER['PHP_SELF'] usage
This commit is contained in:
parent
9582714089
commit
b13dbb3dcb
9 changed files with 41 additions and 26 deletions
|
@ -106,15 +106,16 @@ class Mode
|
|||
/**
|
||||
* Checks if the site is called via a backend process
|
||||
*
|
||||
* @param bool $isBackend True, if the call is from a backend script (daemon, worker, ...)
|
||||
* @param Module $module The pre-loaded module (just name, not class!)
|
||||
* @param array $server The $_SERVER variable
|
||||
* @param MobileDetect $mobileDetect The mobile detection library
|
||||
*
|
||||
* @return Mode returns the determined mode
|
||||
*/
|
||||
public function determineRunMode(Module $module, array $server, MobileDetect $mobileDetect)
|
||||
public function determineRunMode(bool $isBackend, Module $module, array $server, MobileDetect $mobileDetect)
|
||||
{
|
||||
$isBackend = basename(($server['PHP_SELF'] ?? ''), '.php') !== 'index' ||
|
||||
$isBackend = $isBackend ||
|
||||
$module->isBackend();
|
||||
$isMobile = $mobileDetect->isMobile();
|
||||
$isTablet = $mobileDetect->isTablet();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue