]> source.dussan.org Git - nextcloud-server.git/commitdiff
implement a platform independent version of basename
authorThomas Mueller <thomas.mueller@tmit.eu>
Mon, 29 Jul 2013 16:24:05 +0000 (18:24 +0200)
committerThomas Mueller <thomas.mueller@tmit.eu>
Mon, 29 Jul 2013 16:24:05 +0000 (18:24 +0200)
lib/files/cache/cache.php
lib/util.php

index 3818fdbd84065fb43b7ed2d9f731dddcd3e74674..5b8dc46b771ce72f4b16c976360d1bc7cef232a7 100644 (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);
index 981b05b2b46130a60318203705059da1c9e5fc88..004470908d1289e33d3cd6b925729b989769cb5a 100755 (executable)
@@ -892,4 +892,10 @@ class OC_Util {
 
                return $value;
        }
+
+       public static function basename($file)
+       {
+               $t = explode('/', $file);
+               return array_pop($t);
+       }
 }