Commit: de26b5561f573ffaf9ba079084810fb927bc2099 Author: Stanislav Malyshev <[email protected]> Tue, 15 May 2012 22:35:43 -0700 Parents: 1fdece54d9a53660c9bdc1464390fdd8456c0c7a Branches: PHP-5.4.4
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=de26b5561f573ffaf9ba079084810fb927bc2099 Log: fd fix Changed paths: M UPGRADING M ext/standard/php_fopen_wrapper.c Diff: diff --git a/UPGRADING b/UPGRADING index 391c365..7177a6d 100755 --- a/UPGRADING +++ b/UPGRADING @@ -339,6 +339,8 @@ PHP 5.4 UPGRADE NOTES - ob_start() no longer starts multiple output buffers when passed array("callback1", "callback2", "callback3", ...). +- Since 5.4.4, "php://fd" stream syntax is available only in CLI build. + ============================== 5. Changes to existing classes ============================== diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index a831dd1..b51aaa2 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') { -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
