diff options
author | Ondřej Surý <ondrej@sury.org> | 2012-05-28 16:52:15 +0200 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2012-05-28 16:52:15 +0200 |
commit | 01c525f668ecff08bea21c4ff22745b8f77e8c3a (patch) | |
tree | 07ebb675549d7a8ceb905676e4894151122321ac /ext/standard/php_fopen_wrapper.c | |
parent | d4d61a2bcb9975c8aeddbc6603211064174087a9 (diff) | |
download | php-upstream/5.4.4_rc1.tar.gz |
Imported Upstream version 5.4.4~rc1upstream/5.4.4_rc1
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
-rw-r--r-- | ext/standard/php_fopen_wrapper.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index a831dd1c1..b51aaa219 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -263,6 +263,20 @@ php_stream * php_stream_url_wrap_php(php_stream_wrapper *wrapper, char *path, ch long fildes_ori; int dtablesize; + if (strcmp(sapi_module.name, "cli")) { + if (options & REPORT_ERRORS) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Direct access to file descriptors is only available from command-line PHP"); + } + return NULL; + } + + 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; + } + start = &path[3]; fildes_ori = strtol(start, &end, 10); if (end == start || *end != '\0') { |