PHP8 support

This commit is contained in:
bergware
2023-02-27 05:47:22 +01:00
parent 0ce11576d6
commit f25ab3827b
9 changed files with 59 additions and 46 deletions
+3 -3
View File
@@ -15,7 +15,7 @@
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp';
$notify = "$docroot/webGui/scripts/notify";
switch ($_POST['cmd']) {
switch ($_POST['cmd']??'') {
case 'init':
shell_exec("$notify init");
break;
@@ -48,11 +48,11 @@ case 'get':
break;
case 'hide':
$file = $_POST['file']??'';
if (file_exists($file) && $file==realpath($file) && pathinfo($file)['extension']=='notify') chmod($file,0400);
if (file_exists($file) && $file==realpath($file) && pathinfo($file,PATHINFO_EXTENSION)=='notify') chmod($file,0400);
break;
case 'archive':
$file = $_POST['file']??'';
if (strlen($file) && strpos($file,'/')===false) shell_exec("$notify archive ".escapeshellarg($file));
if ($file && strpos($file,'/')===false) shell_exec("$notify archive ".escapeshellarg($file));
break;
}
?>