From aa3fc149113a146d1e168c248a917c59bd5e7505 Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Fri, 9 Jan 2009 22:14:20 +0000 Subject: [PATCH] MFH: Fixed bug #47042 (PHP cgi sapi is removing SCRIPT_FILENAME for non apache). --- NEWS | 2 ++ sapi/cgi/cgi_main.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ef17e76256..5cee3fbea7 100644 --- a/NEWS +++ b/NEWS @@ -15,6 +15,8 @@ PHP NEWS APA Laboratory (Fixes CVE-2008-5498). (Scott) - Fixed a segfault when malformed string is passed to json_decode(). (Scott) +- Fixed bug #47042 (PHP cgi sapi is removing SCRIPT_FILENAME for non apache). + (Sriram Natarajan) - Fixed bug #47037 (No error when using fopen with empty string). (Cristian Rodriguez R., Felipe) - Fixed bug #47035 (dns_get_record returns a garbage byte at the end of a TXT diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c index 4dbb3ccdf9..d0a2689186 100644 --- a/sapi/cgi/cgi_main.c +++ b/sapi/cgi/cgi_main.c @@ -960,7 +960,9 @@ static void init_request_info(TSRMLS_D) TRANSLATE_SLASHES(env_document_root); } - if (env_path_translated != NULL && env_redirect_url != NULL) { + if (env_path_translated != NULL && env_redirect_url != NULL && + orig_script_filename != NULL && script_path_translated != NULL && + strcmp(orig_script_filename, script_path_translated) != 0) { /* pretty much apache specific. If we have a redirect_url then our script_filename and script_name point to the -- 2.50.1