summaryrefslogtreecommitdiff
path: root/ext/standard/php_fopen_wrapper.c
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2006-11-05 20:08:58 +0000
committerRasmus Lerdorf <rasmus@php.net>2006-11-05 20:08:58 +0000
commitcea64d52fa8f513b58adcbbb93389ae2639c97f6 (patch)
tree6c6f753b8a15cd350e3c378ed633808e978ff682 /ext/standard/php_fopen_wrapper.c
parent86a6812dbba3206ec093e6ea8a2e5c5715a3520a (diff)
downloadphp-git-cea64d52fa8f513b58adcbbb93389ae2639c97f6.tar.gz
data: and php:stdin/input allow_url_include checks
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
-rw-r--r--ext/standard/php_fopen_wrapper.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index bcc33232c3..200ec5f2db 100644
--- a/ext/standard/php_fopen_wrapper.c
+++ b/ext/standard/php_fopen_wrapper.c
@@ -187,10 +187,22 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch
}
if (!strcasecmp(path, "input")) {
+ if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
+ if (options & REPORT_ERRORS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ }
+ return NULL;
+ }
return php_stream_alloc(&php_stream_input_ops, ecalloc(1, sizeof(off_t)), 0, "rb");
- }
+ }
if (!strcasecmp(path, "stdin")) {
+ if ((options & STREAM_OPEN_FOR_INCLUDE) && !PG(allow_url_include) ) {
+ if (options & REPORT_ERRORS) {
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "URL file-access is disabled in the server configuration");
+ }
+ return NULL;
+ }
if (!strcmp(sapi_module.name, "cli")) {
static int cli_in = 0;
fd = STDIN_FILENO;