From 99a2aa0f804e1ccbeb0fa15dc440506b1f15098e Mon Sep 17 00:00:00 2001 From: Sascha Schumann Date: Sun, 18 Jul 1999 15:53:50 +0000 Subject: [PATCH] allow access to std{in,out,err} by using the php domain --- main/fopen_wrappers.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) { -- 2.50.1