com php-src: Fixed bug #74719: NEWS ext/standard/file.c ext/standard/tests/file/bug74719.phpt ext/standard/tests/file/f open_variation4.phpt
ext/standard/tests/file/mkdir_va riation4.phpt ext/standard/tests/file/rename_variation 10.phpt ext/standard/tests/file/rmdir_variation2. phpt
ext/standard/tests/file/unlink_error-win32-mb.ph pt ext/standard/tests/file/unlink_error-win32.phpt ext/standard/tests/file/unlink_error.phpt
ext/standard/te sts/file/unlin
| From: | Nikita Popov | Date: | Wed, 17 Jan 2018 11:46:59 +0000 |
| Subject: | com php-src: Fixed bug #74719: NEWS ext/standard/file.c ext/standard/tests/file/bug74719.phpt ext/standard/tests/file/f open_variation4.phpt ext/standard/tests/file/mkdir_va riation4.phpt ext/standard/tests/file/rename_variation 10.phpt ext/standard/tests/file/rmdir_variation2. phpt ext/standard/tests/file/unlink_error-win32-mb.ph pt ext/standard/tests/file/unlink_error-win32.phpt ext/standard/tests/file/unlink_error.phpt ext/standard/te sts/file/unlin |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100934@lists.php.net to get a copy of this message | ||
Commit: a01de10b075de9558dfe27535e601c7c4c0c819e
Author: alexanderholman <alexander@holman.org.uk> Fri, 5 Jan 2018 00:42:06 +0000
Committer: Nikita Popov <nikita.ppv@gmail.com> Wed, 17 Jan 2018 12:46:59 +0100
Parents: af8de0aa952eadb896ebc1ae09bf94cb416a6263
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a01de10b075de9558dfe27535e601c7c4c0c819e
Log:
Fixed bug #74719
Allow stream context arguments for fopen, rename, unlink, mkdir
and rmdir to be null.
Bugs:
https://bugs.php.net/74719
Changed paths:
M NEWS
M ext/standard/file.c
A ext/standard/tests/file/bug74719.phpt
M ext/standard/tests/file/fopen_variation4.phpt
M ext/standard/tests/file/mkdir_variation4.phpt
M ext/standard/tests/file/rename_variation10.phpt
M ext/standard/tests/file/rmdir_variation2.phpt
M ext/standard/tests/file/unlink_error-win32-mb.phpt
M ext/standard/tests/file/unlink_error-win32.phpt
M ext/standard/tests/file/unlink_error.phpt
M ext/standard/tests/file/unlink_variation7.phpt
diff --git a/NEWS b/NEWS index 6dad612..fd1e610 100644 --- a/NEWS +++ b/NEWS @@ -160,10 +160,11 @@ PHP NEWS used). (Anton Artamonov) - Standard: - . Fixed unzserialize(), to disable creation of unsupported data structures + . Fixed unserialize(), to disable creation of unsupported data structures through manually crafted strings. (Dmitry) . Fixed bug #75409 (accept EFAULT in addition to ENOSYS as indicator that getrandom() is missing). (sarciszewski) + . Fixed bug #74719 (fopen() should accept NULL as context). (Alexander Holman) - Testing: . Implemented request #62055 (Make run-tests.php support --CGI-- sections). diff --git a/ext/standard/file.c b/ext/standard/file.c index 9c69874..d5b52e0 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -883,7 +883,7 @@ PHP_NAMED_FUNCTION(php_if_fopen) Z_PARAM_STRING(mode, mode_len) Z_PARAM_OPTIONAL Z_PARAM_BOOL(use_include_path) - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1346,7 +1346,7 @@ PHP_FUNCTION(mkdir) Z_PARAM_OPTIONAL Z_PARAM_LONG(mode) Z_PARAM_BOOL(recursive) - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1367,7 +1367,7 @@ PHP_FUNCTION(rmdir) ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_PATH(dir, dir_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1469,7 +1469,7 @@ PHP_FUNCTION(rename) Z_PARAM_PATH(old_name, old_name_len) Z_PARAM_PATH(new_name, new_name_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0); @@ -1508,7 +1508,7 @@ PHP_FUNCTION(unlink) ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_PATH(filename, filename_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1665,7 +1665,7 @@ PHP_FUNCTION(copy) Z_PARAM_PATH(source, source_len) Z_PARAM_PATH(target, target_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END(); if (php_check_open_basedir(source)) { diff --git a/ext/standard/tests/file/bug74719.phpt b/ext/standard/tests/file/bug74719.phpt new file mode 100644 index 0000000..57309bc --- /dev/null +++ b/ext/standard/tests/file/bug74719.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #74719 Allow NULL as context, testing fopen, rename, unlink, mkdir and rmdir +--CREDITS-- +Alexander Holman <alexander@holman.org.uk> +--FILE-- +<?php + +// fopen +$tmpFile = __DIR__ . "/bug74719.tmp"; +$h = fopen($tmpFile, "w", false, NULL); +if ($h !== false) { + echo "ok\n"; + fclose($h); +} + +$newTmpFile = __DIR__ . "/bug74719_renamed.tmp"; +if (rename($tmpFile, $newTmpFile, NULL)) { + echo "ok\n"; +} + +if (unlink($newTmpFile, NULL)) { + echo "ok\n"; +} + +$tmpDir = __DIR__ . "/bug74719_dir"; + +if (mkdir($tmpDir, 0777, false, NULL)) { + echo "ok\n"; +} + +if (rmdir($tmpDir, NULL)) { + echo "ok\n"; +} + +?> +===DONE=== +--EXPECT-- +ok +ok +ok +ok +ok +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index 38f5fef..4bd5b2a 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -182,12 +182,10 @@ Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --lowercase null-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --lowercase true-- Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) @@ -238,12 +236,10 @@ Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --unset var-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --file resource-- Error: 2 - fopen(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/mkdir_variation4.phpt b/ext/standard/tests/file/mkdir_variation4.phpt index deb6ff4..a866f8d 100644 --- a/ext/standard/tests/file/mkdir_variation4.phpt +++ b/ext/standard/tests/file/mkdir_variation4.phpt @@ -167,10 +167,10 @@ Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) --uppercase NULL-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --lowercase null-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --lowercase true-- Error: 2 - mkdir() expects parameter 4 to be resource, boolean given, %s(%d) @@ -209,10 +209,10 @@ Error: 2 - mkdir() expects parameter 4 to be resource, object given, %s(%d) Error: 2 - mkdir() expects parameter 4 to be resource, object given, %s(%d) --undefined var-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --unset var-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --file resource-- Error: 2 - mkdir(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/rename_variation10.phpt b/ext/standard/tests/file/rename_variation10.phpt index 42909ee..5c81757 100644 --- a/ext/standard/tests/file/rename_variation10.phpt +++ b/ext/standard/tests/file/rename_variation10.phpt @@ -184,12 +184,10 @@ Error: 2 - rename() expects parameter 3 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase null-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase true-- Error: 2 - rename() expects parameter 3 to be resource, boolean given, %s(%d) @@ -240,12 +238,10 @@ Error: 2 - rename() expects parameter 3 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --unset var-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --file resource-- Error: 2 - rename(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/rmdir_variation2.phpt b/ext/standard/tests/file/rmdir_variation2.phpt index 7b4311c..6053018 100644 --- a/ext/standard/tests/file/rmdir_variation2.phpt +++ b/ext/standard/tests/file/rmdir_variation2.phpt @@ -175,12 +175,10 @@ Error: 2 - rmdir() expects parameter 2 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase null-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase true-- Error: 2 - rmdir() expects parameter 2 to be resource, boolean given, %s(%d) @@ -231,12 +229,10 @@ Error: 2 - rmdir() expects parameter 2 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --unset var-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --0-- Error: 2 - rmdir(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index 4ce4ca7..51afc36 100644 --- a/ext/standard/tests/file/unlink_error-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_error-win32-mb.phpt @@ -45,7 +45,6 @@ var_dump( file_exists(false) ); // confirm file doesnt exist var_dump( unlink($filename, '') ); // $context as empty string var_dump( unlink($filename, false) ); // $context as boolean false -var_dump( unlink($filename, NULL) ); // $context as NULL echo "\n-- Testing unlink() on non-existent file --\n"; @@ -98,9 +97,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -Warning: unlink() expects parameter 2 to be resource, null given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index f7a1239..305e989 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -43,7 +43,6 @@ var_dump( file_exists(false) ); // confirm file doesnt exist var_dump( unlink($filename, '') ); // $context as empty string var_dump( unlink($filename, false) ); // $context as boolean false -var_dump( unlink($filename, NULL) ); // $context as NULL echo "\n-- Testing unlink() on non-existent file --\n"; @@ -95,9 +94,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -Warning: unlink() expects parameter 2 to be resource, null given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index ae888bc..b1af8fd 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -43,7 +43,6 @@ var_dump( file_exists(false) ); // confirm file doesnt exist var_dump( unlink($filename, '') ); // $context as empty string var_dump( unlink($filename, false) ); // $context as boolean false -var_dump( unlink($filename, NULL) ); // $context as NULL echo "\n-- Testing unlink() on non-existent file --\n"; @@ -95,9 +94,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -Warning: unlink() expects parameter 2 to be resource, null given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_variation7.phpt b/ext/standard/tests/file/unlink_variation7.phpt index 64a2607..f165e4e 100644 --- a/ext/standard/tests/file/unlink_variation7.phpt +++ b/ext/standard/tests/file/unlink_variation7.phpt @@ -177,12 +177,10 @@ Error: 2 - unlink() expects parameter 2 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase null-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase true-- Error: 2 - unlink() expects parameter 2 to be resource, boolean given, %s(%d) @@ -233,12 +231,10 @@ Error: 2 - unlink() expects parameter 2 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --unset var-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --file resource-- Error: 2 - unlink(): supplied resource is not a valid Stream-Context resource, %s(%d)
diff --git a/NEWS b/NEWS index 6dad612..fd1e610 100644 --- a/NEWS +++ b/NEWS @@ -160,10 +160,11 @@ PHP NEWS used). (Anton Artamonov) - Standard: - . Fixed unzserialize(), to disable creation of unsupported data structures + . Fixed unserialize(), to disable creation of unsupported data structures through manually crafted strings. (Dmitry) . Fixed bug #75409 (accept EFAULT in addition to ENOSYS as indicator that getrandom() is missing). (sarciszewski) + . Fixed bug #74719 (fopen() should accept NULL as context). (Alexander Holman) - Testing: . Implemented request #62055 (Make run-tests.php support --CGI-- sections). diff --git a/ext/standard/file.c b/ext/standard/file.c index 9c69874..d5b52e0 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -883,7 +883,7 @@ PHP_NAMED_FUNCTION(php_if_fopen) Z_PARAM_STRING(mode, mode_len) Z_PARAM_OPTIONAL Z_PARAM_BOOL(use_include_path) - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1346,7 +1346,7 @@ PHP_FUNCTION(mkdir) Z_PARAM_OPTIONAL Z_PARAM_LONG(mode) Z_PARAM_BOOL(recursive) - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1367,7 +1367,7 @@ PHP_FUNCTION(rmdir) ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_PATH(dir, dir_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1469,7 +1469,7 @@ PHP_FUNCTION(rename) Z_PARAM_PATH(old_name, old_name_len) Z_PARAM_PATH(new_name, new_name_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); wrapper = php_stream_locate_url_wrapper(old_name, NULL, 0); @@ -1508,7 +1508,7 @@ PHP_FUNCTION(unlink) ZEND_PARSE_PARAMETERS_START(1, 2) Z_PARAM_PATH(filename, filename_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END_EX(RETURN_FALSE); context = php_stream_context_from_zval(zcontext, 0); @@ -1665,7 +1665,7 @@ PHP_FUNCTION(copy) Z_PARAM_PATH(source, source_len) Z_PARAM_PATH(target, target_len) Z_PARAM_OPTIONAL - Z_PARAM_RESOURCE(zcontext) + Z_PARAM_RESOURCE_EX(zcontext, 1, 0) ZEND_PARSE_PARAMETERS_END(); if (php_check_open_basedir(source)) { diff --git a/ext/standard/tests/file/bug74719.phpt b/ext/standard/tests/file/bug74719.phpt new file mode 100644 index 0000000..57309bc --- /dev/null +++ b/ext/standard/tests/file/bug74719.phpt @@ -0,0 +1,43 @@ +--TEST-- +Bug #74719 Allow NULL as context, testing fopen, rename, unlink, mkdir and rmdir +--CREDITS-- +Alexander Holman <alexander@holman.org.uk> +--FILE-- +<?php + +// fopen +$tmpFile = __DIR__ . "/bug74719.tmp"; +$h = fopen($tmpFile, "w", false, NULL); +if ($h !== false) { + echo "ok\n"; + fclose($h); +} + +$newTmpFile = __DIR__ . "/bug74719_renamed.tmp"; +if (rename($tmpFile, $newTmpFile, NULL)) { + echo "ok\n"; +} + +if (unlink($newTmpFile, NULL)) { + echo "ok\n"; +} + +$tmpDir = __DIR__ . "/bug74719_dir"; + +if (mkdir($tmpDir, 0777, false, NULL)) { + echo "ok\n"; +} + +if (rmdir($tmpDir, NULL)) { + echo "ok\n"; +} + +?> +===DONE=== +--EXPECT-- +ok +ok +ok +ok +ok +===DONE=== diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index 38f5fef..4bd5b2a 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -182,12 +182,10 @@ Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --lowercase null-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --lowercase true-- Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) @@ -238,12 +236,10 @@ Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --unset var-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) +ok --file resource-- Error: 2 - fopen(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/mkdir_variation4.phpt b/ext/standard/tests/file/mkdir_variation4.phpt index deb6ff4..a866f8d 100644 --- a/ext/standard/tests/file/mkdir_variation4.phpt +++ b/ext/standard/tests/file/mkdir_variation4.phpt @@ -167,10 +167,10 @@ Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) Error: 2 - mkdir() expects parameter 4 to be resource, array given, %s(%d) --uppercase NULL-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --lowercase null-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --lowercase true-- Error: 2 - mkdir() expects parameter 4 to be resource, boolean given, %s(%d) @@ -209,10 +209,10 @@ Error: 2 - mkdir() expects parameter 4 to be resource, object given, %s(%d) Error: 2 - mkdir() expects parameter 4 to be resource, object given, %s(%d) --undefined var-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --unset var-- -Error: 2 - mkdir() expects parameter 4 to be resource, null given, %s(%d) +Directory created --file resource-- Error: 2 - mkdir(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/rename_variation10.phpt b/ext/standard/tests/file/rename_variation10.phpt index 42909ee..5c81757 100644 --- a/ext/standard/tests/file/rename_variation10.phpt +++ b/ext/standard/tests/file/rename_variation10.phpt @@ -184,12 +184,10 @@ Error: 2 - rename() expects parameter 3 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase null-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase true-- Error: 2 - rename() expects parameter 3 to be resource, boolean given, %s(%d) @@ -240,12 +238,10 @@ Error: 2 - rename() expects parameter 3 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --unset var-- -Error: 2 - rename() expects parameter 3 to be resource, null given, %s(%d) -bool(false) +bool(true) --file resource-- Error: 2 - rename(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/rmdir_variation2.phpt b/ext/standard/tests/file/rmdir_variation2.phpt index 7b4311c..6053018 100644 --- a/ext/standard/tests/file/rmdir_variation2.phpt +++ b/ext/standard/tests/file/rmdir_variation2.phpt @@ -175,12 +175,10 @@ Error: 2 - rmdir() expects parameter 2 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase null-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase true-- Error: 2 - rmdir() expects parameter 2 to be resource, boolean given, %s(%d) @@ -231,12 +229,10 @@ Error: 2 - rmdir() expects parameter 2 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --unset var-- -Error: 2 - rmdir() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --0-- Error: 2 - rmdir(): supplied resource is not a valid Stream-Context resource, %s(%d) diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index 4ce4ca7..51afc36 100644 --- a/ext/standard/tests/file/unlink_error-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_error-win32-mb.phpt @@ -45,7 +45,6 @@ var_dump( file_exists(false) ); // confirm file doesnt exist var_dump( unlink($filename, '') ); // $context as empty string var_dump( unlink($filename, false) ); // $context as boolean false -var_dump( unlink($filename, NULL) ); // $context as NULL echo "\n-- Testing unlink() on non-existent file --\n"; @@ -98,9 +97,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -Warning: unlink() expects parameter 2 to be resource, null given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index f7a1239..305e989 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -43,7 +43,6 @@ var_dump( file_exists(false) ); // confirm file doesnt exist var_dump( unlink($filename, '') ); // $context as empty string var_dump( unlink($filename, false) ); // $context as boolean false -var_dump( unlink($filename, NULL) ); // $context as NULL echo "\n-- Testing unlink() on non-existent file --\n"; @@ -95,9 +94,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -Warning: unlink() expects parameter 2 to be resource, null given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index ae888bc..b1af8fd 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -43,7 +43,6 @@ var_dump( file_exists(false) ); // confirm file doesnt exist var_dump( unlink($filename, '') ); // $context as empty string var_dump( unlink($filename, false) ); // $context as boolean false -var_dump( unlink($filename, NULL) ); // $context as NULL echo "\n-- Testing unlink() on non-existent file --\n"; @@ -95,9 +94,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -Warning: unlink() expects parameter 2 to be resource, null given in %s on line %d -bool(false) - -- Testing unlink() on non-existent file -- Warning: unlink(%s/non_existent_file.tmp): No such file or directory in %s on line %d diff --git a/ext/standard/tests/file/unlink_variation7.phpt b/ext/standard/tests/file/unlink_variation7.phpt index 64a2607..f165e4e 100644 --- a/ext/standard/tests/file/unlink_variation7.phpt +++ b/ext/standard/tests/file/unlink_variation7.phpt @@ -177,12 +177,10 @@ Error: 2 - unlink() expects parameter 2 to be resource, array given, %s(%d) bool(false) --uppercase NULL-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase null-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --lowercase true-- Error: 2 - unlink() expects parameter 2 to be resource, boolean given, %s(%d) @@ -233,12 +231,10 @@ Error: 2 - unlink() expects parameter 2 to be resource, object given, %s(%d) bool(false) --undefined var-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --unset var-- -Error: 2 - unlink() expects parameter 2 to be resource, null given, %s(%d) -bool(false) +bool(true) --file resource-- Error: 2 - unlink(): supplied resource is not a valid Stream-Context resource, %s(%d)