From 8cda1eeef1c6fa3e7f1e9125c90a85f3371a6688 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Fri, 5 Jan 2018 00:42:06 +0000 Subject: [PATCH 01/17] adjust Z_PARAM_RESOURCE to Z_PARAM_RESOURCE_EX in order to check NULL --- ext/standard/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index 5a1b3b955cb06..97c8fd71e894b 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -881,7 +881,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); From 2c4608789181e37ce8bc19558b4525d222262ce3 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Fri, 5 Jan 2018 00:43:24 +0000 Subject: [PATCH 02/17] add tests for fix #74719 --- ext/standard/tests/file/bug74719.phpt | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 ext/standard/tests/file/bug74719.phpt diff --git a/ext/standard/tests/file/bug74719.phpt b/ext/standard/tests/file/bug74719.phpt new file mode 100644 index 0000000000000..73d5aa9084a85 --- /dev/null +++ b/ext/standard/tests/file/bug74719.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #74719 Allow NULL as context +--CREDITS-- +Alexander Holman +--FILE-- + +===DONE=== +--EXPECT-- +open and write okay +open and read okay +===DONE=== From 8d015e0373c2e2256254e5123c4651bdbd91db3a Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Fri, 5 Jan 2018 01:14:56 +0000 Subject: [PATCH 03/17] remove expected false if is null --- ext/standard/tests/file/fopen_variation4.phpt | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index 38f5fefe62b51..cb34a1490806b 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -74,10 +74,6 @@ $inputs = array( 'associative array' => $assoc_array, 'nested arrays' => array('foo', $index_array, $assoc_array), - // null data - 'uppercase NULL' => NULL, - 'lowercase null' => null, - // boolean data 'lowercase true' => true, 'lowercase false' =>false, @@ -181,14 +177,6 @@ bool(false) 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) - ---lowercase null-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) - --lowercase true-- Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) bool(false) From 06ceb93fd26bae673e6177af6c40111ca66f442c Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Fri, 5 Jan 2018 01:47:28 +0000 Subject: [PATCH 04/17] remove remaining NULL failure tests --- ext/standard/tests/file/fopen_variation4.phpt | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index cb34a1490806b..035bc5b14e5ec 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -93,12 +93,6 @@ $inputs = array( // object data 'instance of classWithToString' => new classWithToString(), 'instance of classWithoutToString' => new classWithoutToString(), - - // undefined data - 'undefined var' => @$undefined_var, - - // unset data - 'unset var' => @$unset_var, //file resource 'file resource' => $fileresource @@ -225,14 +219,6 @@ bool(false) 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) - ---unset var-- -Error: 2 - fopen() expects parameter 4 to be resource, null given, %s(%d) -bool(false) - --file resource-- Error: 2 - fopen(): supplied resource is not a valid Stream-Context resource, %s(%d) ok From 90cee2a30576ad4aee602808d2832eb120511980 Mon Sep 17 00:00:00 2001 From: Alexander Holman MBCS AMIAP Date: Tue, 9 Jan 2018 15:25:37 +0000 Subject: [PATCH 05/17] Update file.c update all `Z_PARAM_RESOURCE` references to `Z_PARAM_RESOURCE_EX` where context argument is available --- ext/standard/file.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index 97c8fd71e894b..a14e93652846d 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1344,7 +1344,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); @@ -1365,7 +1365,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); @@ -1467,7 +1467,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); @@ -1506,7 +1506,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); @@ -1663,7 +1663,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)) { From 4e4b685626697e58ad83b92844f00c2d397b692f Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 15:50:02 +0000 Subject: [PATCH 06/17] update test to allow creation of dir with null context --- ext/standard/tests/file/mkdir_variation4.phpt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/standard/tests/file/mkdir_variation4.phpt b/ext/standard/tests/file/mkdir_variation4.phpt index deb6ff4a450c9..b3f2a7717a9bd 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) From dbf5bbc029855ccec06745d38bfb37624cb7da7e Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 15:51:23 +0000 Subject: [PATCH 07/17] update test to allow rename with null context --- ext/standard/tests/file/rename_variation10.phpt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/standard/tests/file/rename_variation10.phpt b/ext/standard/tests/file/rename_variation10.phpt index 42909ee484d06..f1b5044aac0f1 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) From 62c47918f8aeb9ad05336d52bcec5a3951e39c09 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 15:52:02 +0000 Subject: [PATCH 08/17] update test to allow directory removal with null context --- ext/standard/tests/file/rmdir_variation2.phpt | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ext/standard/tests/file/rmdir_variation2.phpt b/ext/standard/tests/file/rmdir_variation2.phpt index 7b4311c245537..67c2e5864cf3c 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) From 62fe6afb6dd38fa14ff623ce5475c858a107adf7 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 15:53:24 +0000 Subject: [PATCH 09/17] update test to allow unlinking with null context --- ext/standard/tests/file/unlink_error.phpt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index ae888bce4acb6..2fb047cd6a0e6 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -95,8 +95,7 @@ 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) +bool(true) -- Testing unlink() on non-existent file -- From 6af4106b2bf78badb88f55a00af6af6c34eb7b1e Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 16:07:31 +0000 Subject: [PATCH 10/17] simplify test --- ext/standard/tests/file/bug74719.phpt | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) diff --git a/ext/standard/tests/file/bug74719.phpt b/ext/standard/tests/file/bug74719.phpt index 73d5aa9084a85..efad94a1deaf7 100644 --- a/ext/standard/tests/file/bug74719.phpt +++ b/ext/standard/tests/file/bug74719.phpt @@ -20,35 +20,17 @@ $newpath = relative_include_path(); set_include_path($newpath); $tmpfile = basename(__FILE__, ".php") . ".tmp"; -$h = fopen($tmpfile, "w", true, NULL); -if ($h === false) { - echo "Unable to open file to write\n"; -} -else { - echo "open and write okay\n"; - fwrite($h, "This is the test file"); - fclose($h); - $h = fopen($tmpfile, "r", false, NULL); - if ($h === false) { - echo "Unable to open file to read file\n"; - } - else { - echo "open and read okay\n"; - fclose($h); - } - unlink($tmpfile); +$h = fopen($tmpfile, "r", true, NULL); +if ($h !== false) { + echo "opened with NULL context\n"; } teardown_relative_path(); restore_include_path(); chdir(".."); rmdir($thisTestDir); - -function runtest() { -} ?> ===DONE=== --EXPECT-- -open and write okay -open and read okay +opened with NULL context ===DONE=== From daf3ae692c2df6fc7d12bd141b7f841751c93c59 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 16:07:55 +0000 Subject: [PATCH 11/17] return null checks to test but change expected output to ok --- ext/standard/tests/file/fopen_variation4.phpt | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index 035bc5b14e5ec..99c642cf83e53 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -74,6 +74,10 @@ $inputs = array( 'associative array' => $assoc_array, 'nested arrays' => array('foo', $index_array, $assoc_array), + // null data + 'uppercase NULL' => NULL, + 'lowercase null' => null, + // boolean data 'lowercase true' => true, 'lowercase false' =>false, @@ -93,6 +97,12 @@ $inputs = array( // object data 'instance of classWithToString' => new classWithToString(), 'instance of classWithoutToString' => new classWithoutToString(), + + // undefined data + 'undefined var' => @$undefined_var, + + // unset data + 'unset var' => @$unset_var, //file resource 'file resource' => $fileresource @@ -171,6 +181,12 @@ bool(false) Error: 2 - fopen() expects parameter 4 to be resource, array given, %s(%d) bool(false) +--uppercase NULL-- +ok + +--lowercase null-- +ok + --lowercase true-- Error: 2 - fopen() expects parameter 4 to be resource, boolean given, %s(%d) bool(false) @@ -215,6 +231,12 @@ bool(false) Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) bool(false) +--undefined var-- +ok + +--unset var-- +ok + --instance of classWithoutToString-- Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) bool(false) From 08d0b03531ccac4d855803b8c2f222f7f3639633 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 16:29:36 +0000 Subject: [PATCH 12/17] update bug test to open with 'w' mode and include tests for rename, unlink, mkdir and rmdir --- ext/standard/tests/file/bug74719.phpt | 33 +++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/ext/standard/tests/file/bug74719.phpt b/ext/standard/tests/file/bug74719.phpt index efad94a1deaf7..7cf90487e24f5 100644 --- a/ext/standard/tests/file/bug74719.phpt +++ b/ext/standard/tests/file/bug74719.phpt @@ -1,5 +1,5 @@ --TEST-- -Bug #74719 Allow NULL as context +Bug #74719 Allow NULL as context, testing fopen, rename, unlink, mkdir and rmdir --CREDITS-- Alexander Holman --FILE-- @@ -19,10 +19,31 @@ chdir($thisTestDir); $newpath = relative_include_path(); set_include_path($newpath); +// fopen $tmpfile = basename(__FILE__, ".php") . ".tmp"; -$h = fopen($tmpfile, "r", true, NULL); +$h = fopen($tmpfile, "w", true, NULL); if ($h !== false) { - echo "opened with NULL context\n"; + echo "ok\n"; + fclose($h); +} +$newTmpFile = "renamed_" . $tmpfile; + +if (rename($tmpfile, $newTmpFile, NULL)) { + echo "ok\n"; +} + +if (unlink($newTmpFile, NULL)) { + echo "ok\n"; +} + +$tmpDir = "tmpDir"; + +if (mkdir($tmpDir, 0777, false, NULL)) { + echo "ok\n"; +} + +if (rmdir($tmpDir, NULL)) { + echo "ok\n"; } teardown_relative_path(); @@ -32,5 +53,9 @@ rmdir($thisTestDir); ?> ===DONE=== --EXPECT-- -opened with NULL context +ok +ok +ok +ok +ok ===DONE=== From 1de22e40032182f74e041e76dba0be56fc540a3c Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 16:43:08 +0000 Subject: [PATCH 13/17] fix expected output --- ext/standard/tests/file/mkdir_variation4.phpt | 4 ++-- ext/standard/tests/file/rename_variation10.phpt | 6 ++---- ext/standard/tests/file/rmdir_variation2.phpt | 6 ++---- ext/standard/tests/file/unlink_error.phpt | 1 - ext/standard/tests/file/unlink_variation7.phpt | 12 ++++-------- 5 files changed, 10 insertions(+), 19 deletions(-) diff --git a/ext/standard/tests/file/mkdir_variation4.phpt b/ext/standard/tests/file/mkdir_variation4.phpt index b3f2a7717a9bd..a866f8d16f691 100644 --- a/ext/standard/tests/file/mkdir_variation4.phpt +++ b/ext/standard/tests/file/mkdir_variation4.phpt @@ -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 f1b5044aac0f1..5c81757ed80cf 100644 --- a/ext/standard/tests/file/rename_variation10.phpt +++ b/ext/standard/tests/file/rename_variation10.phpt @@ -238,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 67c2e5864cf3c..6053018f42d74 100644 --- a/ext/standard/tests/file/rmdir_variation2.phpt +++ b/ext/standard/tests/file/rmdir_variation2.phpt @@ -229,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.phpt b/ext/standard/tests/file/unlink_error.phpt index 2fb047cd6a0e6..90d0342d3d0bd 100644 --- a/ext/standard/tests/file/unlink_error.phpt +++ b/ext/standard/tests/file/unlink_error.phpt @@ -94,7 +94,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) - bool(true) -- Testing unlink() on non-existent file -- diff --git a/ext/standard/tests/file/unlink_variation7.phpt b/ext/standard/tests/file/unlink_variation7.phpt index 64a2607d5f5ce..f165e4e9c2d66 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) From df3b015adfd7bf9200922607a6b2f4892885cba2 Mon Sep 17 00:00:00 2001 From: Alexander Holman MBCS AMIAP Date: Sun, 14 Jan 2018 16:46:35 +0000 Subject: [PATCH 14/17] Update fopen_variation4.phpt fix output expected to be in correct order --- ext/standard/tests/file/fopen_variation4.phpt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/standard/tests/file/fopen_variation4.phpt b/ext/standard/tests/file/fopen_variation4.phpt index 99c642cf83e53..4bd5b2a446e32 100644 --- a/ext/standard/tests/file/fopen_variation4.phpt +++ b/ext/standard/tests/file/fopen_variation4.phpt @@ -231,16 +231,16 @@ bool(false) Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) bool(false) +--instance of classWithoutToString-- +Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) +bool(false) + --undefined var-- ok --unset var-- ok ---instance of classWithoutToString-- -Error: 2 - fopen() expects parameter 4 to be resource, object given, %s(%d) -bool(false) - --file resource-- Error: 2 - fopen(): supplied resource is not a valid Stream-Context resource, %s(%d) ok From 0eb19a81b34b2e486bf4593f8dc9a43d2523cb80 Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 17:42:37 +0000 Subject: [PATCH 15/17] update unlink win32 error tests --- ext/standard/tests/file/unlink_error-win32-mb.phpt | 4 +--- ext/standard/tests/file/unlink_error-win32.phpt | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index 5111f34b76f7c..2fb97efed3870 100644 --- a/ext/standard/tests/file/unlink_error-win32-mb.phpt +++ b/ext/standard/tests/file/unlink_error-win32-mb.phpt @@ -97,9 +97,7 @@ 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) +bool(true) -- Testing unlink() on non-existent file -- diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index e55f6ed5cd48d..b8ede0031c705 100644 --- a/ext/standard/tests/file/unlink_error-win32.phpt +++ b/ext/standard/tests/file/unlink_error-win32.phpt @@ -94,9 +94,7 @@ 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) +bool(true) -- Testing unlink() on non-existent file -- From fd845b5091a2a5b3355ddbbdbf44740cc109dd3c Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 17:44:24 +0000 Subject: [PATCH 16/17] remove null context from unlink errors test as they no loger produce errors --- ext/standard/tests/file/unlink_error-win32-mb.phpt | 2 -- ext/standard/tests/file/unlink_error-win32.phpt | 2 -- ext/standard/tests/file/unlink_error.phpt | 2 -- 3 files changed, 6 deletions(-) diff --git a/ext/standard/tests/file/unlink_error-win32-mb.phpt b/ext/standard/tests/file/unlink_error-win32-mb.phpt index 2fb97efed3870..e96aa05b9c37a 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"; @@ -97,7 +96,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -bool(true) -- Testing unlink() on non-existent file -- diff --git a/ext/standard/tests/file/unlink_error-win32.phpt b/ext/standard/tests/file/unlink_error-win32.phpt index b8ede0031c705..8c73c353583f4 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"; @@ -94,7 +93,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -bool(true) -- Testing unlink() on non-existent file -- diff --git a/ext/standard/tests/file/unlink_error.phpt b/ext/standard/tests/file/unlink_error.phpt index 90d0342d3d0bd..b1af8fd736202 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"; @@ -94,7 +93,6 @@ bool(false) Warning: unlink() expects parameter 2 to be resource, boolean given in %s on line %d bool(false) -bool(true) -- Testing unlink() on non-existent file -- From dc0735ef6215bfad5e76975adc21db618c9f4f5c Mon Sep 17 00:00:00 2001 From: alexanderholman Date: Sun, 14 Jan 2018 18:25:48 +0000 Subject: [PATCH 17/17] update curl check win config to include samba protocols exist to pass test AppVeyor -- not part of bug --- ext/curl/tests/check_win_config.phpt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/curl/tests/check_win_config.phpt b/ext/curl/tests/check_win_config.phpt index 405a1b9072098..7f656ef9ea753 100644 --- a/ext/curl/tests/check_win_config.phpt +++ b/ext/curl/tests/check_win_config.phpt @@ -45,7 +45,7 @@ GSSAPI => No KERBEROS5 => Yes UNIX_SOCKETS => No PSL => No -Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smtp, smtps, telnet, tftp +Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp Host => %s-pc-win32 SSL Version => OpenSSL/%s ZLib Version => %s