summaryrefslogtreecommitdiff
path: root/ext/standard/string.c
diff options
context:
space:
mode:
authorkrakjoe <joe.watkins@live.co.uk>2014-02-02 13:42:01 +0000
committerkrakjoe <joe.watkins@live.co.uk>2014-02-02 13:42:01 +0000
commita4a120d66aaf44cd0dc71f39a49998b924c2ef0e (patch)
treef48300cf85374f82a437a42f3a2d4ed88867f34d /ext/standard/string.c
parent8a7e2f8dd2116ff6ada654e301c593accf337250 (diff)
parent05c309f2d85bcc33e95415d7f50d7748a7c27498 (diff)
downloadphp-git-a4a120d66aaf44cd0dc71f39a49998b924c2ef0e.tar.gz
Merge branch 'PHP-5.6' of https://git.php.net/repository/php-src into PHP-5.6
Diffstat (limited to 'ext/standard/string.c')
-rw-r--r--ext/standard/string.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 2f05b65bb9..b47319be31 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -2,7 +2,7 @@
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
- | Copyright (c) 1997-2013 The PHP Group |
+ | Copyright (c) 1997-2014 The PHP Group |
+----------------------------------------------------------------------+
| This source file is subject to version 3.01 of the PHP license, |
| that is bundled with this package in the file LICENSE, and is |
@@ -1437,6 +1437,19 @@ PHPAPI void php_basename(const char *s, size_t len, char *suffix, size_t sufflen
state = 0;
cend = c;
}
+#if defined(PHP_WIN32) || defined(NETWARE)
+ /* Catch relative paths in c:file.txt style. They're not to confuse
+ with the NTFS streams. This part ensures also, that no drive
+ letter traversing happens. */
+ } else if ((*c == ':' && (c - comp == 1))) {
+ if (state == 0) {
+ comp = c;
+ state = 1;
+ } else {
+ cend = c;
+ state = 0;
+ }
+#endif
} else {
if (state == 0) {
comp = c;