From c52e7d360fb9a0e57fe895724f4d082f9338a716 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Sat, 1 May 2010 23:09:36 +0200 Subject: [PATCH] More bug fixes, mostly IE related --- files/api.php | 3 +++ inc/lib_base.php | 2 +- inc/lib_files.php | 3 +++ js/filebrowser.js | 4 ++-- js/lib_files.js | 15 ++++++++++----- 5 files changed, 19 insertions(+), 8 deletions(-) diff --git a/files/api.php b/files/api.php index 5a4c8801d4..b27228d967 100755 --- a/files/api.php +++ b/files/api.php @@ -23,6 +23,9 @@ require_once('../inc/lib_base.php'); $arguments=$_POST; +if(!isset($_POST['action']) and isset($_GET['action'])){ + $arguments=$_GET; +} foreach($arguments as &$argument){ $argument=stripslashes($argument); diff --git a/inc/lib_base.php b/inc/lib_base.php index 4b5fb06a49..4abcccd4b4 100755 --- a/inc/lib_base.php +++ b/inc/lib_base.php @@ -76,7 +76,7 @@ if(!is_dir($CONFIG_DATADIRECTORY)){ } if(OC_USER::isLoggedIn()){ //jail the user in a seperate data folder - $CONFIG_DATADIRECTORY.=$_SESSION['username_clean']; + $CONFIG_DATADIRECTORY.='/'.$_SESSION['username_clean']; if(!is_dir($CONFIG_DATADIRECTORY)){ mkdir($CONFIG_DATADIRECTORY); } diff --git a/inc/lib_files.php b/inc/lib_files.php index 2e77067b4a..9bd349bfd0 100755 --- a/inc/lib_files.php +++ b/inc/lib_files.php @@ -94,6 +94,9 @@ class OC_FILES { if(strstr($files,'..') or strstr($dir,'..')){ die(); } + if(strpos($files,';')){ + $files=explode(';',$files); + } if(is_array($files)){ $zip = new ZipArchive(); $filename = sys_get_temp_dir()."/ownCloud.zip"; diff --git a/js/filebrowser.js b/js/filebrowser.js index 18567f202c..c95e129064 100755 --- a/js/filebrowser.js +++ b/js/filebrowser.js @@ -30,11 +30,11 @@ OC_FILES.browser.showInitial=function(){ OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback,true); } -OC_FILES.browser.show=function(dir){ +OC_FILES.browser.show=function(dir,forceReload){ if(!dir || !dir.split){ dir=''; } - OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback); + OC_FILES.getdirectorycontent(dir,OC_FILES.browser.show_callback,forceReload); } OC_FILES.browser.breadcrumb=new Object(); diff --git a/js/lib_files.js b/js/lib_files.js index c66fc8d121..aa70120e5e 100755 --- a/js/lib_files.js +++ b/js/lib_files.js @@ -88,7 +88,7 @@ OC_FILES.getdirectorycontent=function(dir,callback,refresh){ OC_FILES.dir=''; OC_FILES.get=function(dir,file){ - window.location='files/api.php?action=get&dir='+encodeURIComponent(dir)+'&files='+encodeURIComponent(file); + window.location='files/api.php?action=get&dir='+encodeURIComponent(dir)+'&file='+encodeURIComponent(file); } OC_FILES.upload=function(dir,iframeId){ @@ -148,7 +148,13 @@ OC_FILES.upload_callback=function(iframeId){ this.uploadForm.parentNode.removeChild(this.uploadForm); this.parentNode.removeChild(this); OC_FILES.uploadIFrames[file.iframeId]=null; - OC_FILES.browser.show(file.dir); + if(file.name){ + OC_FILES.browser.show(file.dir); + }else{ + OC_FILES.browser.show(file.dir,true);//if the data from the file isn't correct, force a reload of the cache + } + }else{ + OC_FILES.browser.show(OC_FILES.dir); } } @@ -208,7 +214,7 @@ OC_FILES.remove_callback=function(req,name){ OC_FILES.getSelected=function(){ var nodes=document.getElementsByName('fileSelector'); var files=Array(); - for(index in nodes){ + for(var index=0;index