--- embedaddon/php/ext/standard/php_fopen_wrapper.c 2012/05/29 12:34:43 1.1.1.2 +++ embedaddon/php/ext/standard/php_fopen_wrapper.c 2013/07/22 01:32:05 1.1.1.3 @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2012 The PHP Group | + | Copyright (c) 1997-2013 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ | Hartmut Holzgraefe | +----------------------------------------------------------------------+ */ -/* $Id: php_fopen_wrapper.c,v 1.1.1.2 2012/05/29 12:34:43 misho Exp $ */ +/* $Id: php_fopen_wrapper.c,v 1.1.1.3 2013/07/22 01:32:05 misho Exp $ */ #include #include @@ -262,6 +262,20 @@ php_stream * php_stream_url_wrap_php(php_stream_wrappe *end; 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);