Ok. That is the same with me @badmonkey (we both use ISPConfig).
The error:
The ".." is not a file at all. The line complained is "if ($dir->isDir())" of which "$dir" revert back to "$iter" in the function below:
function readFileVersions(&$version_info, $directories, $pattern, $recursive = false)
{
// The comment looks roughly like... that.
$version_regex = '~\*\s@version\s+(.+)[\s]{2}~i';
$unknown_version = '??';
$ext_offset = -strlen($pattern);
foreach ($directories as $type => $dirname)
{
if ($recursive === true)
{
$iter = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator($dirname, RecursiveDirectoryIterator::SKIP_DOTS),
RecursiveIteratorIterator::CHILD_FIRST,
RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied"
);
}
else
{
$iter = new IteratorIterator(new DirectoryIterator($dirname));
}
foreach ($iter as $dir)
{
if ($dir->isDir())
{
continue;
}
$entry = $dir->getFilename();
if (substr($entry, $ext_offset) == $pattern)
{
if ($dir->isWritable() === false)
{
continue;
}
// Read the first 768 bytes from the file.... enough for the header.
$header = file_get_contents($dir->getPathname(), false, null, 0, 768);
if ($recursive === true)
{
$entry_key = $dir->getPathname();
}
else
{
$entry_key = $entry;
}
// Look for the version comment in the file header.
if (preg_match($version_regex, $header, $match) == 1)
$version_info[$type][$entry_key] = $match[1];
// It wasn't found, but the file was... show a $unknown_version.
else
$version_info[$type][$entry_key] = $unknown_version;
}
}
}
}
I think, somehow, "$iter" also catches ".." as file which it should not. The php coding is an advanced one (to me), so I am not quite sure I understand correctly nor I am able to help on determining the true error or fixing this one.
I hope @emanule can look into it.