From 1348c03ca01ab93f3b358c82addba72eb5f58b4a Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 13 Oct 2020 14:46:17 +0200 Subject: [PATCH 1/2] FIX avoid spaces in file name --- htdocs/admin/system/phpinfo.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index 05038c13bbc..c9f98457aee 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -265,8 +265,8 @@ $db->close(); */ function getActivatedExtensions() { - $file = getConfigFilePath(); - $handle = fopen(GetConfigFilePath(), "r"); + $file = trim(getConfigFilePath()); + $handle = fopen($file, "r"); $content = fread($handle, filesize($file)); fclose($handle); From 00ee1a743316238c82ae1f5868990d66e17e6107 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 13 Oct 2020 15:08:43 +0200 Subject: [PATCH 2/2] FIX compatibility with LF (Line Feed) --- htdocs/admin/system/phpinfo.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/htdocs/admin/system/phpinfo.php b/htdocs/admin/system/phpinfo.php index c9f98457aee..9f1766a5d22 100644 --- a/htdocs/admin/system/phpinfo.php +++ b/htdocs/admin/system/phpinfo.php @@ -273,6 +273,11 @@ function getActivatedExtensions() $configLines = explode("\r", $content); + // For compatibility with LF (Line Feed) + if (empty($configLines) || count($configLines) < 2) { + $configLines = explode("\n", $content); + } + $extensions = array(); $lastLine = ""; @@ -281,11 +286,13 @@ function getActivatedExtensions() $line = trim($line); // ignore comment lines - if (substr($line, 0, 1) === ";") + if (substr($line, 0, 1) === ";" || empty($line)) { continue; } + // var_dump($line); + // extension if (substr($line, 0, 9) === "extension" && substr($line, 0, 10) !== "extension_") {