From 6f8c0ee4dbd250a7deac52063e40878a680d2a01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= <come.chilliet@fusiondirectory.org> Date: Tue, 22 Jun 2021 10:33:08 +0200 Subject: [PATCH] :ambulance: fix(core) Remove double underscore from autoload function name This fixes a warning from PHPCompatiblity about a possible future conflict with PHP internal functions. issue #6167 --- html/index.php | 8 ++++---- include/functions.inc | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/html/index.php b/html/index.php index 5a53e3d53..304e73ced 100644 --- a/html/index.php +++ b/html/index.php @@ -119,8 +119,8 @@ if (isset($_REQUEST['signout']) && $_REQUEST['signout']) { if ($config->get_cfg_value('casActivated') == 'TRUE') { require_once('CAS.php'); /* Move FD autoload after CAS autoload */ - spl_autoload_unregister('__fusiondirectory_autoload'); - spl_autoload_register('__fusiondirectory_autoload'); + spl_autoload_unregister('fusiondirectory_autoload'); + spl_autoload_register('fusiondirectory_autoload'); phpCAS::client( CAS_VERSION_2_0, $config->get_cfg_value('casHost', 'localhost'), @@ -580,8 +580,8 @@ if ($config->get_cfg_value('httpAuthActivated') == 'TRUE') { } elseif ($config->get_cfg_value('casActivated') == 'TRUE') { require_once('CAS.php'); /* Move FD autoload after CAS autoload */ - spl_autoload_unregister('__fusiondirectory_autoload'); - spl_autoload_register('__fusiondirectory_autoload'); + spl_autoload_unregister('fusiondirectory_autoload'); + spl_autoload_register('fusiondirectory_autoload'); Index::casLoginProcess(); } elseif ($config->get_cfg_value('httpHeaderAuthActivated') == 'TRUE') { Index::headerAuthLoginProcess(); diff --git a/include/functions.inc b/include/functions.inc index 5f848ed87..1a9bd6138 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -83,7 +83,7 @@ $REWRITE = array( "ä" => "ae", * \param array $class_name list of class name */ -function __fusiondirectory_autoload($class_name) +function fusiondirectory_autoload ($class_name) { global $class_mapping, $BASE_DIR, $config; @@ -117,7 +117,7 @@ function __fusiondirectory_autoload($class_name) exit; } } -spl_autoload_register('__fusiondirectory_autoload'); +spl_autoload_register('fusiondirectory_autoload'); /*! -- GitLab