|
| 1 | +--TEST-- |
| 2 | +Bug #73962 bug with symlink related to cyrillic directory |
| 3 | +--SKIPIF-- |
| 4 | +<?php |
| 5 | +if(substr(PHP_OS, 0, 3) != 'WIN' ) { |
| 6 | + die('skip windows only test'); |
| 7 | +} |
| 8 | +include_once __DIR__ . '/common.inc'; |
| 9 | +$ret = exec('mklink bug48746_tmp.lnk ' . __FILE__ .' 2>&1', $out); |
| 10 | +if (strpos($ret, 'privilege')) { |
| 11 | + die('skip. SeCreateSymbolicLinkPrivilege not enable for this user.'); |
| 12 | +} |
| 13 | +unlink('bug48746_tmp.lnk'); |
| 14 | +?> |
| 15 | +--FILE-- |
| 16 | +<?php |
| 17 | +include_once __DIR__ . '/common.inc'; |
| 18 | +$mountvol = get_mountvol(); |
| 19 | +$old_dir = __DIR__; |
| 20 | +$dirname = '"' . __DIR__ . "\\mnt\\test\\новая папка" . '"'; |
| 21 | +exec("mkdir " . $dirname, $output, $ret_val); |
| 22 | +chdir(__DIR__ . "\\mnt\\test"); |
| 23 | +$drive = substr(__DIR__, 0, 2); |
| 24 | +$pathwithoutdrive = substr(__DIR__, 2); |
| 25 | +$ret = exec($mountvol . " " . $drive . " /L", $output, $ret_val); |
| 26 | +exec("mklink /d mounted_volume " . $ret, $output, $ret_val); |
| 27 | +$fullpath = "mounted_volume" . $pathwithoutdrive; |
| 28 | +exec("mklink /d mklink_symlink \"новая папка\"", $output, $ret_val); |
| 29 | +file_put_contents("mklink_symlink\\a.php", "<?php echo \"I am included.\n\" ?>"); |
| 30 | +file_put_contents("$fullpath\\mnt\\test\\новая папка\\b.php", "<?php echo \"I am included.\n\" ?>"); |
| 31 | +var_dump(scandir("mklink_symlink")); |
| 32 | +var_dump(scandir("$fullpath\\mnt\\test\\новая папка")); |
| 33 | +var_dump(scandir("$fullpath\\mnt\\test\\mklink_symlink")); |
| 34 | +var_dump(is_readable("$fullpath\\mnt\\test\\mklink_symlink\b.php")); |
| 35 | +unlink("$fullpath\\mnt\\test\\новая папка\\b.php"); |
| 36 | +unlink("mklink_symlink\\a.php"); |
| 37 | +chdir($old_dir); |
| 38 | +rmdir(__DIR__ . "\\mnt\\test\\новая папка"); |
| 39 | +rmdir(__DIR__ . "\\mnt\\test\\mklink_symlink"); |
| 40 | +rmdir(__DIR__ . "\\mnt\\test\\mounted_volume"); |
| 41 | +rmdir(__DIR__ . "\\mnt\\test"); |
| 42 | +rmdir(__DIR__ . "\\mnt"); |
| 43 | + |
| 44 | +?> |
| 45 | +--EXPECT-- |
| 46 | +array(4) { |
| 47 | + [0]=> |
| 48 | + string(1) "." |
| 49 | + [1]=> |
| 50 | + string(2) ".." |
| 51 | + [2]=> |
| 52 | + string(5) "a.php" |
| 53 | + [3]=> |
| 54 | + string(5) "b.php" |
| 55 | +} |
| 56 | +array(4) { |
| 57 | + [0]=> |
| 58 | + string(1) "." |
| 59 | + [1]=> |
| 60 | + string(2) ".." |
| 61 | + [2]=> |
| 62 | + string(5) "a.php" |
| 63 | + [3]=> |
| 64 | + string(5) "b.php" |
| 65 | +} |
| 66 | +array(4) { |
| 67 | + [0]=> |
| 68 | + string(1) "." |
| 69 | + [1]=> |
| 70 | + string(2) ".." |
| 71 | + [2]=> |
| 72 | + string(5) "a.php" |
| 73 | + [3]=> |
| 74 | + string(5) "b.php" |
| 75 | +} |
| 76 | +bool(true) |
| 77 | + |
0 commit comments