dmitry Mon Sep 10 10:55:27 2007 UTC Modified files: (Branch: PHP_5_2) /php-src NEWS /php-src/sapi/cgi cgi_main.c Log: Fixed bug #42587 (behaviour change regarding symlinked .php files) http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.938&r2=1.2027.2.547.2.939&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.938 php-src/NEWS:1.2027.2.547.2.939 --- php-src/NEWS:1.2027.2.547.2.938 Sun Sep 9 16:34:05 2007 +++ php-src/NEWS Mon Sep 10 10:55:26 2007 @@ -14,6 +14,7 @@ - Fixed bug #42590 (Make the engine recornize \v and \f escape sequences). (Ilia) +- Fixed bug #42587 (behaviour change regarding symlinked .php files). (Dmitry) - Fixed bug #42579 (apache_reset_timeout() does not exist). (Jani) - Fixed bug #42549 (ext/mysql failed to compile with libmysql 3.23). (Scott) - Fixed bug #42523 (PHP_SELF duplicates path). (Dmitry) http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.48&r2=1.267.2.15.2.49&diff_format=u Index: php-src/sapi/cgi/cgi_main.c diff -u php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.48 php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.49 --- php-src/sapi/cgi/cgi_main.c:1.267.2.15.2.48 Wed Sep 5 08:26:32 2007 +++ php-src/sapi/cgi/cgi_main.c Mon Sep 10 10:55:26 2007 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: cgi_main.c,v 1.267.2.15.2.48 2007/09/05 08:26:32 dmitry Exp $ */ +/* $Id: cgi_main.c,v 1.267.2.15.2.49 2007/09/10 10:55:26 dmitry Exp $ */ #include "php.h" #include "php_globals.h" @@ -777,6 +777,7 @@ struct stat st; char *env_redirect_url = sapi_cgibin_getenv("REDIRECT_URL", sizeof("REDIRECT_URL")-1 TSRMLS_CC); char *env_document_root = sapi_cgibin_getenv("DOCUMENT_ROOT", sizeof("DOCUMENT_ROOT")-1 TSRMLS_CC); + int script_path_translated_len; /* Hack for buggy IIS that sets incorrect PATH_INFO */ char *env_server_software = sapi_cgibin_getenv("SERVER_SOFTWARE", sizeof("SERVER_SOFTWARE")-1 TSRMLS_CC); @@ -829,9 +830,11 @@ * this fixes url's like /info.php/test */ if (script_path_translated && - (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL) { - char *pt = estrdup(script_path_translated); - int len = strlen(pt); + (script_path_translated_len = strlen(script_path_translated)) > 0 && + (script_path_translated[script_path_translated_len-1] == '/' || + (real_path = tsrm_realpath(script_path_translated, NULL TSRMLS_CC)) == NULL)) { + char *pt = estrndup(script_path_translated, script_path_translated_len); + int len = script_path_translated_len; char *ptr; while ((ptr = strrchr(pt, '/')) || (ptr = strrchr(pt, '\\'))) { @@ -971,9 +974,6 @@ SG(request_info).path_translated = estrdup(script_path_translated); } } 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 && @@ -1006,9 +1006,7 @@ if (script_path_translated && !strstr(script_path_translated, "..")) { SG(request_info).path_translated = estrdup(script_path_translated); } - if (real_path) { - free(real_path); - } + free(real_path); } } else { #endif
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php