cvs: php-src /ext/standard php_fopen_wrapper.c
| From: | Rasmus Lerdorf | Date: | Sun, 05 Nov 2006 20:44:52 +0000 |
| Subject: | cvs: php-src /ext/standard php_fopen_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-41371@lists.php.net to get a copy of this message | ||
rasmus Sun Nov 5 20:44:52 2006 UTC
Modified files:
/php-src/ext/standard php_fopen_wrapper.c
Log:
data: and php:stdin/input allow_url_include checks
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/php_fopen_wrapper.c?r1=1.55&r2=1.56&diff_format=u
Index: php-src/ext/standard/php_fopen_wrapper.c
diff -u php-src/ext/standard/php_fopen_wrapper.c:1.55 php-src/ext/standard/php_fopen_wrapper.c:1.56
--- php-src/ext/standard/php_fopen_wrapper.c:1.55 Fri Nov 3 13:34:39 2006
+++ php-src/ext/standard/php_fopen_wrapper.c Sun Nov 5 20:44:52 2006
@@ -17,7 +17,7 @@
| Hartmut Holzgraefe <hholzgra@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: php_fopen_wrapper.c,v 1.55 2006/11/03 13:34:39 iliaa Exp $ */
+/* $Id: php_fopen_wrapper.c,v 1.56 2006/11/05 20:44:52 rasmus Exp $ */
#include <stdio.h>
#include <stdlib.h>
@@ -185,12 +185,24 @@
if (!strcasecmp(path, "output")) {
return php_stream_alloc(&php_stream_output_ops, NULL, 0, "wb");
}
-
+
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;