|
|
af9dc8 |
Adapted for 5.4.16 from
|
|
|
af9dc8 |
|
|
|
af9dc8 |
From be9b2a95adb504abd5acdc092d770444ad6f6854 Mon Sep 17 00:00:00 2001
|
|
|
af9dc8 |
From: Stanislav Malyshev <stas@php.net>
|
|
|
af9dc8 |
Date: Sat, 9 May 2015 23:13:06 -0700
|
|
|
af9dc8 |
Subject: [PATCH] Fixed bug #69418 - more s->p fixes for filenames
|
|
|
af9dc8 |
|
|
|
af9dc8 |
---
|
|
|
af9dc8 |
ext/pcntl/pcntl.c | 74 +++++++++++++++++++++---------------------
|
|
|
af9dc8 |
ext/standard/basic_functions.c | 24 +++++++-------
|
|
|
af9dc8 |
ext/standard/dir.c | 62 +++++++++++++++++------------------
|
|
|
af9dc8 |
ext/standard/file.c | 10 +++---
|
|
|
af9dc8 |
4 files changed, 85 insertions(+), 85 deletions(-)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
|
|
|
af9dc8 |
index 7a8acaf..6189bdf 100644
|
|
|
af9dc8 |
--- a/ext/pcntl/pcntl.c
|
|
|
af9dc8 |
+++ b/ext/pcntl/pcntl.c
|
|
|
af9dc8 |
@@ -754,19 +754,19 @@ PHP_FUNCTION(pcntl_exec)
|
|
|
af9dc8 |
char *path;
|
|
|
af9dc8 |
int path_len;
|
|
|
af9dc8 |
ulong key_num;
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|aa", &path, &path_len, &args, &envs) == FAILURE) {
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|aa", &path, &path_len, &args, &envs) == FAILURE) {
|
|
|
af9dc8 |
return;
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
if (ZEND_NUM_ARGS() > 1) {
|
|
|
af9dc8 |
/* Build argument list */
|
|
|
af9dc8 |
args_hash = HASH_OF(args);
|
|
|
af9dc8 |
argc = zend_hash_num_elements(args_hash);
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
argv = safe_emalloc((argc + 2), sizeof(char *), 0);
|
|
|
af9dc8 |
*argv = path;
|
|
|
af9dc8 |
- for ( zend_hash_internal_pointer_reset(args_hash), current_arg = argv+1;
|
|
|
af9dc8 |
+ for ( zend_hash_internal_pointer_reset(args_hash), current_arg = argv+1;
|
|
|
af9dc8 |
(argi < argc && (zend_hash_get_current_data(args_hash, (void **) &element) == SUCCESS));
|
|
|
af9dc8 |
(argi++, current_arg++, zend_hash_move_forward(args_hash)) ) {
|
|
|
af9dc8 |
|
|
|
af9dc8 |
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
|
|
|
af9dc8 |
index c3e2230..7d0bfed 100644
|
|
|
af9dc8 |
--- a/ext/standard/basic_functions.c
|
|
|
af9dc8 |
+++ b/ext/standard/basic_functions.c
|
|
|
af9dc8 |
@@ -5433,7 +5433,7 @@ PHP_FUNCTION(set_include_path)
|
|
|
af9dc8 |
int new_value_len;
|
|
|
af9dc8 |
char *old_value;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &new_value, &new_value_len) == FAILURE) {
|
|
|
af9dc8 |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &new_value, &new_value_len) == FAILURE) {
|
|
|
af9dc8 |
return;
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
|
|
|
af9dc8 |
diff --git a/ext/standard/dir.c b/ext/standard/dir.c
|
|
|
af9dc8 |
index c64f37c..27ffb9d 100644
|
|
|
af9dc8 |
--- a/ext/standard/dir.c
|
|
|
af9dc8 |
+++ b/ext/standard/dir.c
|
|
|
af9dc8 |
@@ -219,12 +219,12 @@ static void _php_do_opendir(INTERNAL_FUNCTION_PARAMETERS, int createobject)
|
|
|
af9dc8 |
php_stream_context *context = NULL;
|
|
|
af9dc8 |
php_stream *dirp;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dirname, &dir_len, &zcontext) == FAILURE) {
|
|
|
af9dc8 |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &dirname, &dir_len, &zcontext) == FAILURE) {
|
|
|
af9dc8 |
RETURN_NULL();
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
|
|
|
af9dc8 |
context = php_stream_context_from_zval(zcontext, 0);
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
dirp = php_stream_opendir(dirname, REPORT_ERRORS, context);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
if (dirp == NULL) {
|
|
|
af9dc8 |
@@ -293,11 +293,11 @@ PHP_FUNCTION(chroot)
|
|
|
af9dc8 |
{
|
|
|
af9dc8 |
char *str;
|
|
|
af9dc8 |
int ret, str_len;
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &str_len) == FAILURE) {
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &str, &str_len) == FAILURE) {
|
|
|
af9dc8 |
RETURN_FALSE;
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
ret = chroot(str);
|
|
|
af9dc8 |
if (ret != 0) {
|
|
|
af9dc8 |
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s (errno %d)", strerror(errno), errno);
|
|
|
af9dc8 |
diff --git a/ext/standard/file.c b/ext/standard/file.c
|
|
|
af9dc8 |
index 708c3e2..21e1e53 100644
|
|
|
af9dc8 |
--- a/ext/standard/file.c
|
|
|
af9dc8 |
+++ b/ext/standard/file.c
|
|
|
af9dc8 |
@@ -805,7 +805,7 @@ PHP_FUNCTION(tempnam)
|
|
|
af9dc8 |
char *p;
|
|
|
af9dc8 |
int fd;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ps", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
|
|
|
af9dc8 |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "pp", &dir, &dir_len, &prefix, &prefix_len) == FAILURE) {
|
|
|
af9dc8 |
return;
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -1332,7 +1332,7 @@ PHP_FUNCTION(rmdir)
|
|
|
af9dc8 |
zval *zcontext = NULL;
|
|
|
af9dc8 |
php_stream_context *context;
|
|
|
af9dc8 |
|
|
|
af9dc8 |
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|r", &dir, &dir_len, &zcontext) == FAILURE) {
|
|
|
af9dc8 |
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|r", &dir, &dir_len, &zcontext) == FAILURE) {
|
|
|
af9dc8 |
RETURN_FALSE;
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
|
|
|
af9dc8 |
--
|
|
|
af9dc8 |
2.1.4
|
|
|
af9dc8 |
|
|
|
af9dc8 |
From 634aa0a2dbf8ec5e6fabb4ee01c6d1355ba7ee67 Mon Sep 17 00:00:00 2001
|
|
|
af9dc8 |
From: Stanislav Malyshev <stas@php.net>
|
|
|
af9dc8 |
Date: Sun, 10 May 2015 23:33:44 -0700
|
|
|
af9dc8 |
Subject: [PATCH] Update tests
|
|
|
af9dc8 |
|
|
|
af9dc8 |
---
|
|
|
af9dc8 |
ext/standard/tests/dir/dir_variation1.phpt | 22 +++++++++++-----------
|
|
|
af9dc8 |
.../tests/dir/opendir_variation1-win32.phpt | 12 ++++++------
|
|
|
af9dc8 |
ext/standard/tests/dir/opendir_variation1.phpt | 12 ++++++------
|
|
|
af9dc8 |
.../tests/file/mkdir_rmdir_variation2.phpt | 2 +-
|
|
|
af9dc8 |
.../tests/file/tempnam_variation3-win32.phpt | 18 +++++++++---------
|
|
|
af9dc8 |
ext/standard/tests/file/tempnam_variation3.phpt | 22 ++++++++++++----------
|
|
|
af9dc8 |
.../tests/general_functions/include_path.phpt | 4 ++--
|
|
|
af9dc8 |
7 files changed, 47 insertions(+), 45 deletions(-)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/dir/dir_variation1.phpt b/ext/standard/tests/dir/dir_variation1.phpt
|
|
|
af9dc8 |
index abb4719..fff04ba 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/dir/dir_variation1.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/dir/dir_variation1.phpt
|
|
|
af9dc8 |
@@ -8,7 +8,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
|
|
af9dc8 |
?>
|
|
|
af9dc8 |
--FILE--
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-/*
|
|
|
af9dc8 |
+/*
|
|
|
af9dc8 |
* Prototype : object dir(string $directory[, resource $context])
|
|
|
af9dc8 |
* Description: Directory class with properties, handle and class and methods read, rewind and close
|
|
|
af9dc8 |
* Source code: ext/standard/dir.c
|
|
|
af9dc8 |
@@ -34,7 +34,7 @@ class A
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
|
|
|
af9dc8 |
// get a resource variable
|
|
|
af9dc8 |
-$fp = fopen(__FILE__, "r"); // get a file handle
|
|
|
af9dc8 |
+$fp = fopen(__FILE__, "r"); // get a file handle
|
|
|
af9dc8 |
$dfp = opendir( dirname(__FILE__) ); // get a dir handle
|
|
|
af9dc8 |
|
|
|
af9dc8 |
// unexpected values to be passed to $directory argument
|
|
|
af9dc8 |
@@ -92,27 +92,27 @@ echo "Done";
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 1 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 2 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 3 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 4 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 5 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 6 --
|
|
|
af9dc8 |
@@ -151,16 +151,16 @@ bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 16 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, resource given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, resource given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 17 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, resource given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, resource given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 18 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: dir() expects parameter 1 to be string, object given in %s on line %d
|
|
|
af9dc8 |
+Warning: dir() expects parameter 1 to be a valid path, object given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
-Done
|
|
|
af9dc8 |
\ No newline at end of file
|
|
|
af9dc8 |
+Done
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/dir/opendir_variation1-win32.phpt b/ext/standard/tests/dir/opendir_variation1-win32.phpt
|
|
|
af9dc8 |
index 9a75a5b..9bf3c4a 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/dir/opendir_variation1-win32.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/dir/opendir_variation1-win32.phpt
|
|
|
af9dc8 |
@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) != 'WIN') {
|
|
|
af9dc8 |
--FILE--
|
|
|
af9dc8 |
|
|
|
af9dc8 |
/* Prototype : mixed opendir(string $path[, resource $context])
|
|
|
af9dc8 |
- * Description: Open a directory and return a dir_handle
|
|
|
af9dc8 |
+ * Description: Open a directory and return a dir_handle
|
|
|
af9dc8 |
* Source code: ext/standard/dir.c
|
|
|
af9dc8 |
*/
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -30,7 +30,7 @@ unset ($unset_var);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
// get a class
|
|
|
af9dc8 |
class classA {
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
var $path;
|
|
|
af9dc8 |
function __construct($path) {
|
|
|
af9dc8 |
$this->path = $path;
|
|
|
af9dc8 |
@@ -73,7 +73,7 @@ $inputs = array(
|
|
|
af9dc8 |
false,
|
|
|
af9dc8 |
TRUE,
|
|
|
af9dc8 |
FALSE,
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
// empty data
|
|
|
af9dc8 |
/*16*/ "",
|
|
|
af9dc8 |
'',
|
|
|
af9dc8 |
@@ -83,7 +83,7 @@ $inputs = array(
|
|
|
af9dc8 |
/*19*/ "$path",
|
|
|
af9dc8 |
'string',
|
|
|
af9dc8 |
$heredoc,
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
// object data
|
|
|
af9dc8 |
/*22*/ new classA($path),
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -216,7 +216,7 @@ bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 18 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: opendir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: opendir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 19 --
|
|
|
af9dc8 |
@@ -243,6 +243,6 @@ bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 25 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: opendir() expects parameter 1 to be string, resource given in %s on line %d
|
|
|
af9dc8 |
+Warning: opendir() expects parameter 1 to be a valid path, resource given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
===DONE===
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/dir/opendir_variation1.phpt b/ext/standard/tests/dir/opendir_variation1.phpt
|
|
|
af9dc8 |
index 8d195e1..cb4d543 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/dir/opendir_variation1.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/dir/opendir_variation1.phpt
|
|
|
af9dc8 |
@@ -9,7 +9,7 @@ if (substr(PHP_OS, 0, 3) == 'WIN') {
|
|
|
af9dc8 |
--FILE--
|
|
|
af9dc8 |
|
|
|
af9dc8 |
/* Prototype : mixed opendir(string $path[, resource $context])
|
|
|
af9dc8 |
- * Description: Open a directory and return a dir_handle
|
|
|
af9dc8 |
+ * Description: Open a directory and return a dir_handle
|
|
|
af9dc8 |
* Source code: ext/standard/dir.c
|
|
|
af9dc8 |
*/
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -30,7 +30,7 @@ unset ($unset_var);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
// get a class
|
|
|
af9dc8 |
class classA {
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
var $path;
|
|
|
af9dc8 |
function __construct($path) {
|
|
|
af9dc8 |
$this->path = $path;
|
|
|
af9dc8 |
@@ -73,7 +73,7 @@ $inputs = array(
|
|
|
af9dc8 |
false,
|
|
|
af9dc8 |
TRUE,
|
|
|
af9dc8 |
FALSE,
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
// empty data
|
|
|
af9dc8 |
/*16*/ "",
|
|
|
af9dc8 |
'',
|
|
|
af9dc8 |
@@ -83,7 +83,7 @@ $inputs = array(
|
|
|
af9dc8 |
/*19*/ "$path",
|
|
|
af9dc8 |
'string',
|
|
|
af9dc8 |
$heredoc,
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
// object data
|
|
|
af9dc8 |
/*22*/ new classA($path),
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -194,7 +194,7 @@ bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 18 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: opendir() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: opendir() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 19 --
|
|
|
af9dc8 |
@@ -219,6 +219,6 @@ bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-- Iteration 25 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: opendir() expects parameter 1 to be string, resource given in %s on line %d
|
|
|
af9dc8 |
+Warning: opendir() expects parameter 1 to be a valid path, resource given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
===DONE===
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
|
|
|
af9dc8 |
index 14dd361..24dfc96 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt
|
|
|
af9dc8 |
@@ -68,7 +68,7 @@ bool(false)
|
|
|
af9dc8 |
Warning: mkdir() expects parameter 1 to be a valid path, string given in %s on line %d
|
|
|
af9dc8 |
bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: rmdir(%s): No such file or directory in %s on line %d
|
|
|
af9dc8 |
+Warning: rmdir() expects parameter 1 to be a valid path, string given in %s on line %d
|
|
|
af9dc8 |
bool(false)
|
|
|
af9dc8 |
|
|
|
af9dc8 |
*** Testing mkdir() with miscelleneous input ***
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/file/tempnam_variation3-win32.phpt b/ext/standard/tests/file/tempnam_variation3-win32.phpt
|
|
|
af9dc8 |
index fb457cb..cc8194a 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/file/tempnam_variation3-win32.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/file/tempnam_variation3-win32.phpt
|
|
|
af9dc8 |
@@ -22,9 +22,9 @@ if (!mkdir($file_path)) {
|
|
|
af9dc8 |
|
|
|
af9dc8 |
$file_path = realpath($file_path);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-/* An array of prefixes */
|
|
|
af9dc8 |
+/* An array of prefixes */
|
|
|
af9dc8 |
$names_arr = array(
|
|
|
af9dc8 |
- /* Valid args (casting)*/
|
|
|
af9dc8 |
+ /* Valid args (casting)*/
|
|
|
af9dc8 |
-1,
|
|
|
af9dc8 |
TRUE,
|
|
|
af9dc8 |
FALSE,
|
|
|
af9dc8 |
@@ -32,17 +32,17 @@ $names_arr = array(
|
|
|
af9dc8 |
"",
|
|
|
af9dc8 |
" ",
|
|
|
af9dc8 |
"\0",
|
|
|
af9dc8 |
- /* Invalid args */
|
|
|
af9dc8 |
+ /* Invalid args */
|
|
|
af9dc8 |
array(),
|
|
|
af9dc8 |
|
|
|
af9dc8 |
- /* Valid args*/
|
|
|
af9dc8 |
+ /* Valid args*/
|
|
|
af9dc8 |
/* prefix with path separator of a non existing directory*/
|
|
|
af9dc8 |
- "/no/such/file/dir",
|
|
|
af9dc8 |
+ "/no/such/file/dir",
|
|
|
af9dc8 |
"php/php"
|
|
|
af9dc8 |
);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
$res_arr = array(
|
|
|
af9dc8 |
- /* Invalid args */
|
|
|
af9dc8 |
+ /* Invalid args */
|
|
|
af9dc8 |
true,
|
|
|
af9dc8 |
true,
|
|
|
af9dc8 |
true,
|
|
|
af9dc8 |
@@ -53,7 +53,7 @@ $res_arr = array(
|
|
|
af9dc8 |
false,
|
|
|
af9dc8 |
|
|
|
af9dc8 |
/* prefix with path separator of a non existing directory*/
|
|
|
af9dc8 |
- true,
|
|
|
af9dc8 |
+ true,
|
|
|
af9dc8 |
true
|
|
|
af9dc8 |
);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -72,7 +72,7 @@ for( $i=0; $i
|
|
|
af9dc8 |
} else {
|
|
|
af9dc8 |
echo "Failed, not created in the correct directory " . realpath($file_dir) . ' vs ' . $file_path ."\n";
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
if (!is_writable($file_name)) {
|
|
|
af9dc8 |
printf("%o\n", fileperms($file_name) );
|
|
|
af9dc8 |
|
|
|
af9dc8 |
@@ -105,7 +105,7 @@ Failed, not created in the correct directory %s vs %s
|
|
|
af9dc8 |
OK
|
|
|
af9dc8 |
-- Iteration 7 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: tempnam() expects parameter 2 to be string, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d
|
|
|
af9dc8 |
+Warning: tempnam() expects parameter 2 to be a valid path, array given in %s\ext\standard\tests\file\tempnam_variation3-win32.php on line %d
|
|
|
af9dc8 |
OK
|
|
|
af9dc8 |
-- Iteration 8 --
|
|
|
af9dc8 |
OK
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt
|
|
|
af9dc8 |
index 69ab16c..11b8780 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/file/tempnam_variation3.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/file/tempnam_variation3.phpt
|
|
|
af9dc8 |
@@ -17,9 +17,9 @@ echo "*** Testing tempnam() with obscure prefixes ***\n";
|
|
|
af9dc8 |
$file_path = dirname(__FILE__)."/tempnamVar3";
|
|
|
af9dc8 |
mkdir($file_path);
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-/* An array of prefixes */
|
|
|
af9dc8 |
+/* An array of prefixes */
|
|
|
af9dc8 |
$names_arr = array(
|
|
|
af9dc8 |
- /* Invalid args */
|
|
|
af9dc8 |
+ /* Invalid args */
|
|
|
af9dc8 |
-1,
|
|
|
af9dc8 |
TRUE,
|
|
|
af9dc8 |
FALSE,
|
|
|
af9dc8 |
@@ -30,7 +30,7 @@ $names_arr = array(
|
|
|
af9dc8 |
array(),
|
|
|
af9dc8 |
|
|
|
af9dc8 |
/* prefix with path separator of a non existing directory*/
|
|
|
af9dc8 |
- "/no/such/file/dir",
|
|
|
af9dc8 |
+ "/no/such/file/dir",
|
|
|
af9dc8 |
"php/php"
|
|
|
af9dc8 |
|
|
|
af9dc8 |
);
|
|
|
af9dc8 |
@@ -48,10 +48,10 @@ for( $i=0; $i
|
|
|
af9dc8 |
echo "File permissions are => ";
|
|
|
af9dc8 |
printf("%o", fileperms($file_name) );
|
|
|
af9dc8 |
echo "\n";
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
echo "File created in => ";
|
|
|
af9dc8 |
$file_dir = dirname($file_name);
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
if ($file_dir == sys_get_temp_dir()) {
|
|
|
af9dc8 |
echo "temp dir\n";
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
@@ -61,7 +61,7 @@ for( $i=0; $i
|
|
|
af9dc8 |
else {
|
|
|
af9dc8 |
echo "unknown location\n";
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
-
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
}
|
|
|
af9dc8 |
else {
|
|
|
af9dc8 |
echo "-- File is not created --\n";
|
|
|
af9dc8 |
@@ -100,12 +100,14 @@ File name is => %s/%s
|
|
|
af9dc8 |
File permissions are => 100600
|
|
|
af9dc8 |
File created in => directory specified
|
|
|
af9dc8 |
-- Iteration 6 --
|
|
|
af9dc8 |
-File name is => %s/%s
|
|
|
af9dc8 |
-File permissions are => 100600
|
|
|
af9dc8 |
-File created in => directory specified
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
+Warning: tempnam() expects parameter 2 to be a valid path, string given in %s on line %d
|
|
|
af9dc8 |
+-- File is not created --
|
|
|
af9dc8 |
+
|
|
|
af9dc8 |
+Warning: unlink(): %s in %s on line %d
|
|
|
af9dc8 |
-- Iteration 7 --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: tempnam() expects parameter 2 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: tempnam() expects parameter 2 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
-- File is not created --
|
|
|
af9dc8 |
|
|
|
af9dc8 |
Warning: unlink(): %s in %s on line %d
|
|
|
af9dc8 |
diff --git a/ext/standard/tests/general_functions/include_path.phpt b/ext/standard/tests/general_functions/include_path.phpt
|
|
|
af9dc8 |
index 0392307..8b6626f 100644
|
|
|
af9dc8 |
--- a/ext/standard/tests/general_functions/include_path.phpt
|
|
|
af9dc8 |
+++ b/ext/standard/tests/general_functions/include_path.phpt
|
|
|
af9dc8 |
@@ -41,7 +41,7 @@ var_dump(get_include_path());
|
|
|
af9dc8 |
|
|
|
af9dc8 |
echo "Done\n";
|
|
|
af9dc8 |
?>
|
|
|
af9dc8 |
---EXPECTF--
|
|
|
af9dc8 |
+--EXPECTF--
|
|
|
af9dc8 |
string(1) "."
|
|
|
af9dc8 |
|
|
|
af9dc8 |
Warning: get_include_path() expects exactly 0 parameters, 1 given in %s on line %d
|
|
|
af9dc8 |
@@ -67,7 +67,7 @@ string(1) "."
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
string(1) "."
|
|
|
af9dc8 |
|
|
|
af9dc8 |
-Warning: set_include_path() expects parameter 1 to be string, array given in %s on line %d
|
|
|
af9dc8 |
+Warning: set_include_path() expects parameter 1 to be a valid path, array given in %s on line %d
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
string(1) "."
|
|
|
af9dc8 |
NULL
|
|
|
af9dc8 |
--
|
|
|
af9dc8 |
2.1.4
|
|
|
af9dc8 |
|