- Fixed bug #43293 (Multiple segfaults in getopt()). (Hannes)
- Fixed bug #43279 (pg_send_query_params() converts all elements in 'params'
to strings). (Ilia)
+- Fixed bug #43276 (Incomplete fix for bug #42739, mkdir() under safe_mode).
+ (Ilia)
- Fixed bug #43248 (backward compatibility break in realpath()). (Dmitry)
- Fixed bug #43221 (SimpleXML adding default namespace in addAttribute). (Rob)
- Fixed bug #43216 (stream_is_local() returns false on "file://"). (Dmitry)
/* 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);