mirror of
https://github.com/php/php-src.git
synced 2026-04-16 20:41:18 +02:00
intern->file_name may not have been properly set when DirectoryIterator::getLinkTarget() is called, so we make sure it is before using it.
26 lines
482 B
PHP
26 lines
482 B
PHP
--TEST--
|
|
Bug #68825 (Exception in DirectoryIterator::getLinkTarget())
|
|
--FILE--
|
|
<?php
|
|
$dir = __DIR__ . '/bug68825';
|
|
mkdir($dir);
|
|
symlink(__FILE__, "$dir/foo");
|
|
|
|
$di = new \DirectoryIterator($dir);
|
|
foreach ($di as $entry) {
|
|
if ('foo' === $entry->getFilename()) {
|
|
var_dump($entry->getLinkTarget());
|
|
}
|
|
}
|
|
?>
|
|
===DONE===
|
|
--EXPECTF--
|
|
string(%d) "%s%eext%espl%etests%ebug68825.php"
|
|
===DONE===
|
|
--CLEAN--
|
|
<?php
|
|
$dir = __DIR__ . '/bug68825';
|
|
unlink("$dir/foo");
|
|
rmdir($dir);
|
|
?>
|