From: Sascha Schumann Date: Sun, 18 Jul 1999 15:53:50 +0000 (+0000) Subject: allow access to std{in,out,err} by using the php domain X-Git-Tag: php-4.0b1~69 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99a2aa0f804e1ccbeb0fa15dc440506b1f15098e;p=php allow access to std{in,out,err} by using the php domain --- diff --git a/main/fopen_wrappers.c b/main/fopen_wrappers.c index 8db27317bc..1660874a0a 100644 --- a/main/fopen_wrappers.c +++ b/main/fopen_wrappers.c @@ -603,6 +603,16 @@ static FILE *php3_fopen_url_wrapper(const char *path, char *mode, int options, i free_url(resource); *issock = 1; return (fp); + } else if (!strncasecmp(path, "php://", 6)) { + const char *res = path + 6; + + if (!strcasecmp(res, "stdin")) { + return fdopen(STDIN_FILENO, mode); + } else if (!strcasecmp(res, "stdout")) { + return fdopen(STDOUT_FILENO, mode); + } else if (!strcasecmp(res, "stderr")) { + return fdopen(STDERR_FILENO, mode); + } } else if (!strncasecmp(path, "ftp://", 6)) { resource = url_parse((char *) path); if (resource == NULL) {