iliaa Thu Nov 15 18:57:14 2007 UTC Modified files: (Branch: PHP_5_3) /php-src/main safe_mode.c Log: Completed fix for bug #42739 (fixes bug #43276) http://cvs.php.net/viewvc.cgi/php-src/main/safe_mode.c?r1=1.62.2.1.2.10.2.3&r2=1.62.2.1.2.10.2.4&diff_format=u Index: php-src/main/safe_mode.c diff -u php-src/main/safe_mode.c:1.62.2.1.2.10.2.3 php-src/main/safe_mode.c:1.62.2.1.2.10.2.4 --- php-src/main/safe_mode.c:1.62.2.1.2.10.2.3 Thu Oct 11 09:33:30 2007 +++ php-src/main/safe_mode.c Thu Nov 15 18:57:14 2007 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: safe_mode.c,v 1.62.2.1.2.10.2.3 2007/10/11 09:33:30 jani Exp $ */ +/* $Id: safe_mode.c,v 1.62.2.1.2.10.2.4 2007/11/15 18:57:14 iliaa Exp $ */ #include "php.h" @@ -122,10 +122,17 @@ /* Trim off filename */ if ((s = strrchr(path, DEFAULT_SLASH))) { - if (s == path) - path[1] = '\0'; - else + if (*(s + 1) == '\0' && s != path) { /* make sure that the / is not the last character */ *s = '\0'; + s = strrchr(path, DEFAULT_SLASH); + } + if (s) { + if (s == path) { + path[1] = '\0'; + } else { + *s = '\0'; + } + } } } else { /* CHECKUID_ALLOW_ONLY_DIR */ s = strrchr(filename, DEFAULT_SLASH);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php