bug75679.phpt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. --TEST--
  2. Bug #75679 Path 260 character problem
  3. --FILE--
  4. <?php
  5. $d = __DIR__;
  6. $Files2Report =
  7. [
  8. str_pad ($d . '/' . str_repeat (str_pad ('bug75679_path_259_characters_long_', 100, '_') . '/', 1), 259, '_') => [],
  9. str_pad ($d . '/' . str_repeat (str_pad ('bug75679_path_260_characters_long_', 100, '_') . '/', 1), 260, '_') => [],
  10. str_pad ($d . '/' . str_repeat (str_pad ('bug75679_path_261_characters_long_', 100, '_') . '/', 1), 261, '_') => [],
  11. ];
  12. foreach ($Files2Report as $file => &$Report)
  13. {
  14. $Report = ['strlen' => strlen ($file), 'result' => 'nok'];
  15. if (! is_dir (dirname ($file))) mkdir (dirname ($file), 0777, true);
  16. if (copy (__FILE__, $file) && is_file ($file))
  17. {
  18. $Report['result'] = 'ok';
  19. }
  20. print_r ($Report);
  21. }
  22. ?>
  23. --CLEAN--
  24. <?php
  25. $d = __DIR__;
  26. $Files2Report =
  27. [
  28. str_pad ($d . '/' . str_repeat (str_pad ('bug75679_path_259_characters_long_', 100, '_') . '/', 1), 259, '_') => [],
  29. str_pad ($d . '/' . str_repeat (str_pad ('bug75679_path_260_characters_long_', 100, '_') . '/', 1), 260, '_') => [],
  30. str_pad ($d . '/' . str_repeat (str_pad ('bug75679_path_261_characters_long_', 100, '_') . '/', 1), 261, '_') => [],
  31. ];
  32. foreach ($Files2Report as $file => &$Report)
  33. {
  34. if (is_file($file)) {
  35. unlink($file);
  36. }
  37. $d1 = dirname($file);
  38. while ($d1 != $d) {
  39. rmdir($d1);
  40. $d1 = dirname($d1);
  41. }
  42. }
  43. ?>
  44. --EXPECT--
  45. Array
  46. (
  47. [strlen] => 259
  48. [result] => ok
  49. )
  50. Array
  51. (
  52. [strlen] => 260
  53. [result] => ok
  54. )
  55. Array
  56. (
  57. [strlen] => 261
  58. [result] => ok
  59. )