Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-10-11 23:27:44 +0400
committerRobin Appelman <icewind@owncloud.com>2012-10-12 00:18:34 +0400
commitb9f820d828ff517c952971ece649ef8e28c74bd2 (patch)
tree304133081d1333a65ee007140f808c4016326a22 /3rdparty
parent92ddefe5a6b549daf267322f8e25942d4970de7c (diff)
normalize paths for dir and statcache in smb stream wrapper
Diffstat (limited to '3rdparty')
-rw-r--r--3rdparty/smb4php/smb.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/3rdparty/smb4php/smb.php b/3rdparty/smb4php/smb.php
index c50b26b935e..c080c1b590f 100644
--- a/3rdparty/smb4php/smb.php
+++ b/3rdparty/smb4php/smb.php
@@ -229,6 +229,8 @@ class smb {
}
function addstatcache ($url, $info) {
+ $url = str_replace('//', '/', $url);
+ $url = rtrim($url, '/');
global $__smb_cache;
$is_file = (strpos ($info['attr'],'D') === FALSE);
$s = ($is_file) ? stat ('/etc/passwd') : stat ('/tmp');
@@ -238,11 +240,15 @@ class smb {
}
function getstatcache ($url) {
+ $url = str_replace('//', '/', $url);
+ $url = rtrim($url, '/');
global $__smb_cache;
return isset ($__smb_cache['stat'][$url]) ? $__smb_cache['stat'][$url] : FALSE;
}
function clearstatcache ($url='') {
+ $url = str_replace('//', '/', $url);
+ $url = rtrim($url, '/');
global $__smb_cache;
if ($url == '') $__smb_cache['stat'] = array (); else unset ($__smb_cache['stat'][$url]);
}
@@ -358,16 +364,22 @@ class smb_stream_wrapper extends smb {
# cache
function adddircache ($url, $content) {
+ $url = str_replace('//', '/', $url);
+ $url = rtrim($url, '/');
global $__smb_cache;
return $__smb_cache['dir'][$url] = $content;
}
function getdircache ($url) {
+ $url = str_replace('//', '/', $url);
+ $url = rtrim($url, '/');
global $__smb_cache;
return isset ($__smb_cache['dir'][$url]) ? $__smb_cache['dir'][$url] : FALSE;
}
function cleardircache ($url='') {
+ $url = str_replace('//', '/', $url);
+ $url = rtrim($url, '/');
global $__smb_cache;
if ($url == ''){
$__smb_cache['dir'] = array ();