com php-src: Fixed #73124: php_ini_scanned_files(): NEWS ext/standard/info.c ext/standard/tests/bug73 124.phpt
| From: | Nikita Popov | Date: | Tue, 28 Nov 2017 22:33:48 +0000 |
| Subject: | com php-src: Fixed #73124: php_ini_scanned_files(): NEWS ext/standard/info.c ext/standard/tests/bug73 124.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100429@lists.php.net to get a copy of this message | ||
Commit: 6ed242dfc84a9e58f6e03184d99611f2cfb2a265
Author: johnstevenson <john-stevenson@blueyonder.co.uk> Thu, 16 Nov 2017 17:56:32
+0000
Committer: Nikita Popov <nikita.ppv@gmail.com> Tue, 28 Nov 2017 23:33:48 +0100
Parents: 8b57a5bca0c5a9ba064aa27e7614d1a11c0cac6d
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=6ed242dfc84a9e58f6e03184d99611f2cfb2a265
Log:
Fixed #73124: php_ini_scanned_files()
Additional ini files are reported using the --ini option, but not by
php_ini_scanned_files(), which relied on PHP_CONFIG_FILE_SCAN_DIR.
Bugs:
https://bugs.php.net/73124
Changed paths:
M NEWS
M ext/standard/info.c
A ext/standard/tests/bug73124.phpt
Diff:
diff --git a/NEWS b/NEWS
index 095b91b...6fa8100 100644
--- a/NEWS
+++ b/NEWS
@@ -33,6 +33,8 @@ PHP NEWS
segment fault). (Nikita)
. Fixed bug #75409 (accept EFAULT in addition to ENOSYS as indicator
that getrandom() is missing). (sarciszewski)
+ . Fixed bug #73124 (php_ini_scanned_files() not reporting correctly).
+ (John Stevenson)
- Zip:
. Fixed bug #75540 (Segfault with libzip 1.3.1). (Remi)
diff --git a/ext/standard/info.c b/ext/standard/info.c
index 76802fa..7b045b7 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -1395,7 +1395,7 @@ PHP_FUNCTION(php_ini_scanned_files)
return;
}
- if (strlen(PHP_CONFIG_FILE_SCAN_DIR) && php_ini_scanned_files) {
+ if (php_ini_scanned_files) {
RETURN_STRING(php_ini_scanned_files);
} else {
RETURN_FALSE;
diff --git a/ext/standard/tests/bug73124.phpt b/ext/standard/tests/bug73124.phpt
new file mode 100644
index 0000000..7064d65
--- /dev/null
+++ b/ext/standard/tests/bug73124.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #73124 (php_ini_scanned_files relied on PHP_CONFIG_FILE_SCAN_DIR)
+--SKIPIF--
+<?php
+if (!empty(PHP_CONFIG_FILE_SCAN_DIR)) die("Skip: PHP_CONFIG_FILE_SCAN_DIR must not be
available");
+?>
+--FILE--
+<?php
+ $tempDir = sys_get_temp_dir();
+ putenv('PHP_INI_SCAN_DIR='.$tempDir);
+
+ $inifile = $tempDir.DIRECTORY_SEPARATOR.'scan-dir.ini';
+ @unlink($inifile);
+ file_put_contents($inifile, "\n");
+
+ $php = getenv('TEST_PHP_EXECUTABLE');
+ passthru('"'.$php.'" -r
"print_r(php_ini_scanned_files());"');
+
+ putenv('PHP_INI_SCAN_DIR=');
+ @unlink($inifile);
+?>
+--EXPECTREGEX--
+.*[\/\\]scan-dir\.ini.*|.*[\/\\]scan-dir\.ini
+Done