From 5b6229544d03e59085918151abd010f2700b84f2 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sun, 17 Jun 2012 02:42:40 +0200
Subject: [PATCH] fix statcache for filenames containing non-alphanumeric
 characters in smb streamwrapper

---
 3rdparty/smb4php/smb.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/3rdparty/smb4php/smb.php b/3rdparty/smb4php/smb.php
index 69fb2487bc..12c5890723 100644
--- a/3rdparty/smb4php/smb.php
+++ b/3rdparty/smb4php/smb.php
@@ -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);
-- 
GitLab