diff options
-rw-r--r-- | files/ajax/autocomplete.php | 22 | ||||
-rw-r--r-- | files/templates/part.breadcrumb.php | 2 | ||||
-rw-r--r-- | lib/filesystem.php | 4 |
3 files changed, 15 insertions, 13 deletions
diff --git a/files/ajax/autocomplete.php b/files/ajax/autocomplete.php index af235379800..2c2f665fd6c 100644 --- a/files/ajax/autocomplete.php +++ b/files/ajax/autocomplete.php @@ -40,17 +40,19 @@ $query=strtolower($query); $files=array(); -if(OC_FILESYSTEM::is_dir($base)){ +if(OC_FILESYSTEM::file_exists($base) and OC_FILESYSTEM::is_dir($base)){ $dh = OC_FILESYSTEM::opendir($base); - if(substr($base,-1,1)!='/'){ - $base=$base.'/'; - } - while (($file = readdir($dh)) !== false) { - if ($file != "." && $file != ".."){ - if(substr(strtolower($file),0,$queryLen)==$query){ - $item=$base.$file; - if((!$dirOnly or OC_FILESYSTEM::is_dir($item))){ - $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item); + if($dh){ + if(substr($base,-1,1)!='/'){ + $base=$base.'/'; + } + while (($file = readdir($dh)) !== false) { + if ($file != "." && $file != ".."){ + if(substr(strtolower($file),0,$queryLen)==$query){ + $item=$base.$file; + if((!$dirOnly or OC_FILESYSTEM::is_dir($item))){ + $files[]=(object)array('id'=>$item,'label'=>$item,'name'=>$item); + } } } } diff --git a/files/templates/part.breadcrumb.php b/files/templates/part.breadcrumb.php index 34f955fe675..64e0a474728 100644 --- a/files/templates/part.breadcrumb.php +++ b/files/templates/part.breadcrumb.php @@ -1,5 +1,5 @@ <div class='crumb' data-dir='/'> - <a href="<?php echo link_to("files", "index.php?dir=/"); ?>"><img src="<?php echo image_path("", "actions/go-home.png"); ?>" alt="Root"/></a> + <a href="<?php echo link_to("files", "index.php"); ?>"><img src="<?php echo image_path("", "actions/go-home.png"); ?>" alt="Root"/></a> </div> <?php foreach($_["breadcrumb"] as $crumb): ?> <div class='crumb' data-dir='<?php echo $crumb["dir"];?>'> diff --git a/lib/filesystem.php b/lib/filesystem.php index 1f96e139ab3..56007527ad3 100644 --- a/lib/filesystem.php +++ b/lib/filesystem.php @@ -416,9 +416,9 @@ class OC_FILESYSTEM{ } OC_HOOK::emit( 'OC_FILESYSTEM', 'post_copy', array( 'oldpath' => $path1 ,'newpath'=>$path2)); if(!$exists){ - OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path)); + OC_HOOK::emit( 'OC_FILESYSTEM', 'post_create', array( 'path' => $path2)); } - OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path)); + OC_HOOK::emit( 'OC_FILESYSTEM', 'post_write', array( 'path' => $path2)); return $result; } } |