]> granicus.if.org Git - php/commitdiff
Fixed bug #42739 (mkdir() doesnt like a trailing slash when safe_mode is
authorIlia Alshanetsky <iliaa@php.net>
Sun, 23 Sep 2007 15:19:21 +0000 (15:19 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sun, 23 Sep 2007 15:19:21 +0000 (15:19 +0000)
enabled).

NEWS
main/safe_mode.c

diff --git a/NEWS b/NEWS
index 9f04fce2abdf06688549dc8ca3aa1706a86ff9db..4b61793ca4fa0377f224acc166a5b0ae24df711d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -30,6 +30,8 @@ PHP                                                                        NEWS
   Reported by Laurent gaffie. (Ilia)
 - Fixed imagerectangle regression with 1x1 rectangle (libgd #106). (Pierre)
 
+- Fixed bug #42739 (mkdir() doesnt like a trailing slash when safe_mode is 
+  enabled). (Ilia)
 - Fixed bug #42643 (CLI segfaults if using ATTR_PERSISTENT). (Ilia)
 - Fixed bug #42629 (Dynamically loaded PHP extensions need symbols exported
   on MacOSX). (jdolecek at NetBSD dot org)
index 6dc5640425a551bdddc24924c48263d1e4120f54..0c1523e57c8443ea0b84cab96c958a4d08186bf8 100644 (file)
@@ -125,7 +125,7 @@ PHPAPI int php_checkuid_ex(const char *filename, const char *fopen_mode, int mod
                        /* root dir */
                        path[0] = DEFAULT_SLASH;
                        path[1] = '\0';
-               } else if (s) {
+               } else if (s && *(s + 1) != '\0') { /* make sure that the / is not the last character */
                        *s = '\0';
                        VCWD_REALPATH(filename, path);
                        *s = DEFAULT_SLASH;