Skip to content

Commit 35ea45c

Browse files
committed
Fix ini_get() for boolean values
1 parent 76e013a commit 35ea45c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/simple-phpunit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
6363
if (file_exists("phpunit-$PHPUNIT_VERSION")) {
6464
passthru(sprintf('\\' === DIRECTORY_SEPARATOR ? '(del /S /F /Q %s & rmdir %1$s) >nul': 'rm -rf %s', "phpunit-$PHPUNIT_VERSION"));
6565
}
66-
if (extension_loaded('openssl') && ini_get('allow_url_fopen') && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
66+
if (extension_loaded('openssl') && filter_var(ini_get('allow_url_fopen'), FILTER_VALIDATE_BOOLEAN) && !isset($_SERVER['http_proxy']) && !isset($_SERVER['https_proxy'])) {
6767
$remoteZip = "https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip";
6868
$remoteZipStream = @fopen($remoteZip, 'rb');
6969
if (!$remoteZipStream) {
@@ -214,7 +214,7 @@ if ($components) {
214214
// STATUS_STACK_BUFFER_OVERRUN (-1073740791/0xC0000409)
215215
// STATUS_ACCESS_VIOLATION (-1073741819/0xC0000005)
216216
// STATUS_HEAP_CORRUPTION (-1073740940/0xC0000374)
217-
if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !ini_get('apc.enable_cli') || !in_array($procStatus, array(-1073740791, -1073741819, -1073740940)))) {
217+
if ($procStatus && ('\\' !== DIRECTORY_SEPARATOR || !extension_loaded('apcu') || !filter_var(ini_get('apc.enable_cli'), FILTER_VALIDATE_BOOLEAN) || !in_array($procStatus, array(-1073740791, -1073741819, -1073740940)))) {
218218
$exit = $procStatus;
219219
echo "\033[41mKO\033[0m $component\n\n";
220220
} else {

0 commit comments

Comments
 (0)