implement a platform independent version of basename

This commit is contained in:
Thomas Mueller 2013-07-29 18:24:05 +02:00
parent a3ff771567
commit e2d3225e5a
2 changed files with 7 additions and 1 deletions

View file

@ -200,7 +200,7 @@ class Cache {
$data['path'] = $file;
$data['parent'] = $this->getParentId($file);
$data['name'] = basename($file);
$data['name'] = \OC_Util::basename($file);
$data['encrypted'] = isset($data['encrypted']) ? ((int)$data['encrypted']) : 0;
list($queryParts, $params) = $this->buildParts($data);

View file

@ -892,4 +892,10 @@ class OC_Util {
return $value;
}
public static function basename($file)
{
$t = explode('/', $file);
return array_pop($t);
}
}