]> granicus.if.org Git - php/commitdiff
Fixed bug #40419 (Trailing Slash in CGI request don't work)
authorDmitry Stogov <dmitry@php.net>
Tue, 26 Jun 2007 14:47:16 +0000 (14:47 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 26 Jun 2007 14:47:16 +0000 (14:47 +0000)
NEWS
sapi/cgi/cgi_main.c

diff --git a/NEWS b/NEWS
index 8cd511005ec4565faf88608edbe1084023206c87..8c27a3996f5a5d4e5e1deaa7ed885356ae725903 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -88,6 +88,7 @@ PHP                                                                        NEWS
   integer as sections). (Tony)
 - Fixed bug #41350 (my_thread_global_end() error during request shutdown
   on Windows). (Scott, Andrey)
+- Fixed bug #40419 (Trailing Slash in CGI request don't work). (Dmitry)
 - Fixed bug #39330 (apache2handler does not call shutdown actions before 
   apache child die). (isk at ecommerce dot com, Gopal, Tony)
 
index 67559d6895a85222e3d3ceee25a1428d25ba8b94..bf58269751a99e2106ccf6f9834dbcd2bf47a658 100644 (file)
@@ -766,7 +766,7 @@ static void init_request_info(TSRMLS_D)
                char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC);
 
                if (CGIG(fix_pathinfo)) {
-                       char *real_path;
+                       char *real_path = NULL;
                        char *orig_path_translated = env_path_translated;
                        char *orig_path_info = env_path_info;
                        char *orig_script_name = env_script_name;
@@ -926,6 +926,9 @@ static void init_request_info(TSRMLS_D)
                                        efree(pt);
                                }
                        } else {
+                               if (real_path) {
+                                       script_path_translated = real_path;
+                               }
                                /* make sure path_info/translated are empty */
                                if (!orig_script_filename ||
                                        (script_path_translated != orig_script_filename) ||
@@ -951,8 +954,10 @@ static void init_request_info(TSRMLS_D)
                                } else {
                                        SG(request_info).request_uri = env_script_name;
                                }
+                               if (real_path) {
+                                       free(real_path);
+                               }
                        }                       
-                       free(real_path);
                } else {
 #endif
                        /* pre 4.3 behaviour, shouldn't be used but provides BC */