summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2012-05-15 22:35:43 -0700
committerJohannes Schlüter <johannes@php.net>2012-05-16 16:35:16 +0200
commit6e519895011ea3ef43ce62c1050e72337af94b79 (patch)
tree797783ce3e4d3b25ea75f5471072bf4dff9b46d8 /ext
parent4eb802bb14b05b82573457bc0f528e61ca7ddc45 (diff)
downloadphp-git-6e519895011ea3ef43ce62c1050e72337af94b79.tar.gz
fd fix
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/php_fopen_wrapper.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c
index a831dd1c16..b51aaa219f 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') {