Correction for PHP Deprecated: explode()

More robust syntax if $_GET['section'] turns out to be null, avoid messages as PHP Deprecated:  explode(): Passing null to parameter #2 ($string) of type string is deprecated
This commit is contained in:
Hood-fr 2024-03-03 21:06:30 +01:00 committed by Pierrick Le Gall
parent d69bc8b884
commit 75392e6886

View file

@ -14,7 +14,7 @@ if( !defined("PHPWG_ROOT_PATH") )
include_once(PHPWG_ROOT_PATH.'admin/include/functions.php');
check_status(ACCESS_ADMINISTRATOR);
$sections = explode('/', $_GET['section'] );
$sections = explode('/', $_GET['section'] ?? '');
for ($i=0; $i<count($sections); $i++)
{
if (empty($sections[$i]))
@ -56,4 +56,4 @@ else
{
die('Missing file '.htmlentities($filename));
}
?>
?>