Re: cvs: php4(PHP_4_3) /sapi/cgi cgi_main.c
| From: | Andi Gutmans | Date: | Mon, 02 Dec 2002 05:32:21 +0000 |
| Subject: | Re: cvs: php4(PHP_4_3) /sapi/cgi cgi_main.c | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-91996@lists.php.net to get a copy of this message | ||
Are you sure we should have this stuff in the branch of 4.3? Are these bugs which didn't exist in 4.2.3?
If they did exist I'm -1. If they didn't exist then that's life and the patch should stay in but people familiar with CGI should review it carefully.
Andi
At 02:21 AM 12/2/2002 +0000, Shane Caraveo wrote:
shane Sun Dec 1 21:21:01 2002 EDTModified files: (Branch: PHP_4_3) /php4/sapi/cgi cgi_main.cLog: MFH Index: php4/sapi/cgi/cgi_main.c diff -u php4/sapi/cgi/cgi_main.c:1.190.2.6 php4/sapi/cgi/cgi_main.c:1.190.2.7 --- php4/sapi/cgi/cgi_main.c:1.190.2.6 Sun Dec 1 18:27:14 2002+++ php4/sapi/cgi/cgi_main.c Sun Dec 1 21:21:01 2002@@ -369,6 +369,7 @@} else { snprintf(buf,len-1,"%s=", name); }+ #if PHP_FASTCGI/* when php is started by mod_fastcgi, no regular environment is provided to PHP. It is always sent to PHP at the start@@ -597,8 +598,10 @@struct stat st; char *env_script_name = sapi_cgibin_getenv("SCRIPT_NAME",0 TSRMLS_CC); char *env_path_info = sapi_cgibin_getenv("PATH_INFO",0 TSRMLS_CC); + char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL",0 TSRMLS_CC); if (env_path_info) env_path_info = estrdup(env_path_info); - if (sapi_cgibin_getenv("REDIRECT_URL",0 TSRMLS_CC) ||++ if (env_redirect_url || (env_script_name && env_path_info && strcmp(env_path_info,env_script_name)==0)) { /*@@ -611,6 +614,8 @@*/_sapi_cgibin_putenv("SCRIPT_FILENAME",env_path_translated TSRMLS_CC);_sapi_cgibin_putenv("PATH_INFO",NULL TSRMLS_CC); + if (env_redirect_url) + _sapi_cgibin_putenv("SCRIPT_NAME",env_redirect_url TSRMLS_CC); }if (stat( env_path_translated, &st ) == -1 ) {@@ -620,7 +625,7 @@while( (ptr = strrchr(pt,'/')) || (ptr = strrchr(pt,'\\')) ) { *ptr = 0; - if ( lstat(pt, &st) == 0 && S_ISREG(st.st_mode) ) { + if ( stat(pt, &st) == 0 && S_ISREG(st.st_mode) ) { /* * okay, we found the base script! * work out how many chars we had to strip off;-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php