1--TEST--
2basename bug #66395 check drive traversing and NTFS streams
3--SKIPIF--
4<?php if (substr(PHP_OS, 0, 3) != 'WIN') { die('skip Windows only basename tests'); } ?>
5--FILE--
6<?php
7echo basename("y:") . "\n";
8echo basename("y:/") . "\n";
9echo basename("notdriveletter:file.txt") . "\n";
10echo basename("a:\\b:c:d:hello.txt\\hcd:c.txt") . "\n";
11echo basename("a:b:c:d:hello.txt\\d:some.txt") . "\n";
12echo basename("a:b:c:d:hello\world\a.bmp\c:d:e:f.txt") . "\n";
13echo basename("a:\\b:\\c:d:hello\\world\\a.bmp\\d:e:f:g.txt") . "\n";
14echo basename("a:\\b:\\c:d:hello/world\\a.bmp\\d:\\e:\\f:g.txt") . "\n";
15echo basename("a:\\b:/c:d:hello\\world:somestream") . "\n";
16echo basename("a:\\b:\\c:d:hello\\world:some.stream") . "\n";
17echo basename("a:/b:\\c:d:hello\\world:some.stream:\$DATA") . "\n";
18echo basename("x:y:z:hello\world:my.stream:\$DATA") . "\n";
19echo basename("a:\\b:\\c:d:hello\\world:c:\$DATA") . "\n";
20echo basename("a:\\b:\\c:d:hello\\d:world:c:\$DATA") . "\n";
21?>
22--EXPECT--
23y
24y
25notdriveletter:file.txt
26hcd:c.txt
27some.txt
28f.txt
29g.txt
30g.txt
31world:somestream
32world:some.stream
33world:some.stream:$DATA
34world:my.stream:$DATA
35world:c:$DATA
36world:c:$DATA
37