summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-08-25 12:09:57 +0000
committerWez Furlong <wez@php.net>2002-08-25 12:09:57 +0000
commit5c6ad38c31a42ccdb7a68d775e556575ccf273a1 (patch)
treed998851344e596962ee99532dcd890187dd2be73
parent08ab630dc7eb8ac173b707c952fad5b23f98c01e (diff)
downloadphp-git-5c6ad38c31a42ccdb7a68d775e556575ccf273a1.tar.gz
Prevent possible problems with include_path.
-rw-r--r--ext/standard/file.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index aac3f396e5..456523f752 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -264,8 +264,9 @@ PHP_FUNCTION(get_meta_tags)
php_stream_open_wrapper(filename, "rb", 0, NULL);
+
md.stream = php_stream_open_wrapper(filename, "rb",
- use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+ (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
@@ -412,7 +413,7 @@ PHP_FUNCTION(file_get_contents)
}
stream = php_stream_open_wrapper(filename, "rb",
- use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+ (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
if (!stream) {
RETURN_FALSE;
@@ -459,7 +460,7 @@ PHP_FUNCTION(file)
}
stream = php_stream_open_wrapper(filename, "rb",
- use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+ (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
if (!stream) {
RETURN_FALSE;
@@ -854,7 +855,7 @@ PHP_NAMED_FUNCTION(php_if_fopen)
}
stream = php_stream_open_wrapper_ex(filename, mode,
- use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+ (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL, context);
if (stream == NULL) {
@@ -1579,7 +1580,7 @@ PHP_FUNCTION(readfile)
convert_to_string_ex(arg1);
stream = php_stream_open_wrapper(Z_STRVAL_PP(arg1), "rb",
- use_include_path | ENFORCE_SAFE_MODE | REPORT_ERRORS,
+ (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
if (stream) {
size = php_stream_passthru(stream);