From b6fcfc7f1373894736e370609289cee829d87312 Mon Sep 17 00:00:00 2001 From: "o.pinke" Date: Tue, 1 Sep 2020 15:23:56 +0200 Subject: [PATCH] PHP 7.4 fixes --- setup/lib/functions.filesystem.php | 459 +++++++++++++---------------- setup/lib/functions.phpinfo.php | 168 +++++------ setup/steps/forms/systemtest.php | 40 ++- 3 files changed, 303 insertions(+), 364 deletions(-) diff --git a/setup/lib/functions.filesystem.php b/setup/lib/functions.filesystem.php index 636c4dc..5ea0950 100644 --- a/setup/lib/functions.filesystem.php +++ b/setup/lib/functions.filesystem.php @@ -1,4 +1,5 @@ diff --git a/setup/lib/functions.phpinfo.php b/setup/lib/functions.phpinfo.php index ed6c0a4..e98ac9a 100644 --- a/setup/lib/functions.phpinfo.php +++ b/setup/lib/functions.phpinfo.php @@ -1,4 +1,5 @@ =") == true) - { - if (getPHPIniSetting("register_long_arrays") == false) - { - return false; - } - } - - return true; +function isRegisterLongArraysActive() { + if (version_compare(phpversion(), "5.0.0", ">=") == true) { + if (getPHPIniSetting("register_long_arrays") == false) { + return false; + } + } + + return true; } /** @@ -201,7 +178,8 @@ function isPHPCompatible($sVersion = "5.2.0") { if (version_compare(phpversion(), $sVersion, ">=") == true) { return true; } else { - return false; + return false; } } + ?> \ No newline at end of file diff --git a/setup/steps/forms/systemtest.php b/setup/steps/forms/systemtest.php index b90ff2d..4dc6120 100644 --- a/setup/steps/forms/systemtest.php +++ b/setup/steps/forms/systemtest.php @@ -446,7 +446,7 @@ class cSetupSystemtest extends cSetupMask { } public function doFileSystemTests() { - if(!is_readable(CON_SETUP_PATH."/data")) { + if (!is_readable(CON_SETUP_PATH . "/data")) { $this->runTest(false, C_SEVERITY_ERROR, i18n_setup("Setup data folder not readable!"), i18n_setup("Please check the Folder setup/data! Maybe it' s missing or not readable.")); } // old logs @@ -461,7 +461,7 @@ class cSetupSystemtest extends cSetupMask { $this->logFilePrediction("data/logs/errorlog.txt"); $this->logFilePrediction("data/logs/setuplog.txt"); } - + // new folders in data-folder $this->logFilePrediction("data/cache/"); $this->logFilePrediction("data/temp/"); @@ -471,18 +471,18 @@ class cSetupSystemtest extends cSetupMask { // cronjobs $sFolder = 'data/cronlog/'; - $this->logFilePrediction($sFolder."pseudo-cron.log"); - $this->logFilePrediction($sFolder."session_cleanup.php.job"); - $this->logFilePrediction($sFolder."send_reminder.php.job"); - $this->logFilePrediction($sFolder."optimize_database.php.job"); - $this->logFilePrediction($sFolder."move_old_stats.php.job"); - $this->logFilePrediction($sFolder."move_articles.php.job"); - $this->logFilePrediction($sFolder."linkchecker.php.job"); - $this->logFilePrediction($sFolder."run_newsletter_job.php.job"); - $this->logFilePrediction($sFolder."setfrontenduserstate.php.job"); - $this->logFilePrediction($sFolder."advance_workflow.php.job"); + $this->logFilePrediction($sFolder . "pseudo-cron.log"); + $this->logFilePrediction($sFolder . "session_cleanup.php.job"); + $this->logFilePrediction($sFolder . "send_reminder.php.job"); + $this->logFilePrediction($sFolder . "optimize_database.php.job"); + $this->logFilePrediction($sFolder . "move_old_stats.php.job"); + $this->logFilePrediction($sFolder . "move_articles.php.job"); + $this->logFilePrediction($sFolder . "linkchecker.php.job"); + $this->logFilePrediction($sFolder . "run_newsletter_job.php.job"); + $this->logFilePrediction($sFolder . "setfrontenduserstate.php.job"); + $this->logFilePrediction($sFolder . "advance_workflow.php.job"); + - if ($_SESSION["setuptype"] == "setup" || ($_SESSION["setuptype"] == "migration" && is_dir("../cms/"))) { $this->logFilePrediction("cms/cache/"); @@ -527,19 +527,19 @@ class cSetupSystemtest extends cSetupMask { case C_PREDICT_CHANGEPERM_SAMEOWNER: $mfileperms = substr(sprintf("%o", fileperms("../" . $sFile)), -3); - $mfileperms{0} = intval($mfileperms{0}) | 0x6; + $mfileperms[0] = intval($mfileperms[0]) | 0x6; $sPredictMessage = sprintf(i18n_setup("Your web server and the owner of your files are identical. You need to enable write access for the owner, e.g. using chmod u+rw %s, setting the file mask to %s or set the owner to allow writing the file."), $sFile, $mfileperms); break; case C_PREDICT_CHANGEPERM_SAMEGROUP: $mfileperms = substr(sprintf("%o", fileperms("../" . $sFile)), -3); - $mfileperms{1} = intval($mfileperms{1}) | 0x6; + $mfileperms[1] = intval($mfileperms[1]) | 0x6; $sPredictMessage = sprintf(i18n_setup("Your web server's group and the group of your files are identical. You need to enable write access for the group, e.g. using chmod g+rw %s, setting the file mask to %s or set the group to allow writing the file."), $sFile, $mfileperms); break; case C_PREDICT_CHANGEPERM_OTHERS: $mfileperms = substr(sprintf("%o", fileperms("../" . $sFile)), -3); - $mfileperms{2} = intval($mfileperms{2}) | 0x6; + $mfileperms[2] = intval($mfileperms[2]) | 0x6; $sPredictMessage = sprintf(i18n_setup("Your web server is not equal to the file owner, and is not in the webserver's group. It would be highly insecure to allow world write acess to the files. If you want to install anyways, enable write access for all others, e.g. using chmod o+rw %s, setting the file mask to %s or set the others to allow writing the file."), $sFile, $mfileperms); break; } @@ -558,19 +558,19 @@ class cSetupSystemtest extends cSetupMask { case C_PREDICT_CHANGEPERM_SAMEOWNER: $mfileperms = substr(sprintf("%o", @fileperms($sTarget)), -3); - $mfileperms{0} = intval($mfileperms{0}) | 0x6; + $mfileperms[0] = intval($mfileperms[0]) | 0x6; $sPredictMessage = sprintf(i18n_setup("Your web server and the owner of your directory are identical. You need to enable write access for the owner, e.g. using chmod u+rw %s, setting the directory mask to %s or set the owner to allow writing the directory."), dirname($sFile), $mfileperms); break; case C_PREDICT_CHANGEPERM_SAMEGROUP: $mfileperms = substr(sprintf("%o", @fileperms($sTarget)), -3); - $mfileperms{1} = intval($mfileperms{1}) | 0x6; + $mfileperms[1] = intval($mfileperms[1]) | 0x6; $sPredictMessage = sprintf(i18n_setup("Your web server's group and the group of your directory are identical. You need to enable write access for the group, e.g. using chmod g+rw %s, setting the directory mask to %s or set the group to allow writing the directory."), dirname($sFile), $mfileperms); break; case C_PREDICT_CHANGEPERM_OTHERS: $mfileperms = substr(sprintf("%o", @fileperms($sTarget)), -3); - $mfileperms{2} = intval($mfileperms{2}) | 0x6; + $mfileperms[2] = intval($mfileperms[2]) | 0x6; $sPredictMessage = sprintf(i18n_setup("Your web server is not equal to the directory owner, and is not in the webserver's group. It would be highly insecure to allow world write acess to the directory. If you want to install anyways, enable write access for all others, e.g. using chmod o+rw %s, setting the directory mask to %s or set the others to allow writing the directory."), dirname($sFile), $mfileperms); break; } @@ -580,5 +580,3 @@ class cSetupSystemtest extends cSetupMask { } } - -?>