]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix statcache for filenames containing non-alphanumeric characters in smb streamwrapper
authorRobin Appelman <icewind@owncloud.com>
Sun, 17 Jun 2012 00:42:40 +0000 (02:42 +0200)
committerRobin Appelman <icewind@owncloud.com>
Tue, 10 Jul 2012 12:21:50 +0000 (14:21 +0200)
3rdparty/smb4php/smb.php

index 69fb2487bc0342e28cfa4fe05323a3147eddef92..12c5890723bdb02140af2f39aa22d8b9d7970113 100644 (file)
@@ -326,8 +326,11 @@ class smb_stream_wrapper extends smb {
                                        $this->dir = array_keys($o['info']);
                                        $this->dir_index = 0;
                                        $this->adddircache ($url, $this->dir);
+                                       if(substr($url,-1,1)=='/'){
+                                               $url=substr($url,0,-1);
+                                       }
                                        foreach ($o['info'] as $name => $info) {
-                                               smb::addstatcache($url . '/' . urlencode($name), $info);
+                                               smb::addstatcache($url . '/' . $name, $info);
                                        }
                                } else {
                                        trigger_error ("dir_opendir(): dir failed for path '".$pu['path']."'", E_USER_WARNING);