Skip to content

Commit

Permalink
Correction for PHP Deprecated: explode()
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Hood-fr authored and plegall committed Mar 27, 2024
1 parent d69bc8b commit 75392e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions admin/plugin.php
Expand Up @@ -14,7 +14,7 @@
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]))
Expand Down Expand Up @@ -56,4 +56,4 @@
{
die('Missing file '.htmlentities($filename));
}
?>
?>

0 comments on commit 75392e6

Please sign in to comment.