better parent path bahaviour for the filecache

This commit is contained in:
Robin Appelman 2012-10-03 11:23:33 +02:00
parent 6134e554f2
commit 636c75ce06
1 changed files with 6 additions and 2 deletions

View File

@ -194,10 +194,14 @@ class Cache {
* @return int
*/
public function getParentId($file) {
if ($file === '/' or $file === '') {
if ($file === '') {
return -1;
} else {
return $this->getId(dirname($file));
$parent = dirname($file);
if ($parent === '.') {
$parent = '';
}
return $this->getId($parent);
}
}