]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix folder names with + characters in it
authorMichael Gapczynski <GapczynskiM@gmail.com>
Tue, 27 Dec 2011 17:35:29 +0000 (12:35 -0500)
committerMichael Gapczynski <GapczynskiM@gmail.com>
Tue, 27 Dec 2011 17:35:29 +0000 (12:35 -0500)
files/index.php
files/js/fileactions.js
files/templates/part.list.php

index 7e156130d8e7f2b15cd908620f665afdef83d3ae..189917150ad5b3e2a470198a93e7eb60f017c023 100644 (file)
@@ -71,7 +71,7 @@ $breadcrumb = array();
 $pathtohere = "";
 foreach( explode( "/", $dir ) as $i ){
        if( $i != "" ){
-               $pathtohere .= "/$i";
+               $pathtohere .= "/".urlencode($i);
                $breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
        }
 }
index 9e2688e82c13596ced255d54538e896fd0364a95..4b90ab8cf497a175d00aaa0625bda7434a5be1ce 100644 (file)
@@ -137,7 +137,7 @@ FileActions.register('all','Rename',function(){return OC.imagePath('core','actio
 });
 
 FileActions.register('dir','Open','',function(filename){
-       window.location='index.php?dir='+$('#dir').val()+'/'+filename;
+       window.location='index.php?dir='+encodeURIComponent($('#dir').val())+'/'+encodeURIComponent(filename);
 });
 
 FileActions.setDefault('dir','Open');  
index 46830ba3a37cf8311c56ba80d222e6ab55d9e04c..157ec4ef42ca48ded9569d28b60217d82b317c4d 100644 (file)
@@ -5,10 +5,10 @@
                        $relative_modified_date = relative_modified_date($file['mtime']);
                        $relative_date_color = round((time()-$file['mtime'])/60/60/24*14); // the older the file, the brighter the shade of grey; days*14
                        if($relative_date_color>200) $relative_date_color = 200; ?>
-                       <tr data-file="<?php echo str_replace('+','%20',urlencode($file['name']));?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
+                       <tr data-file="<?php echo str_replace('+','%2B',urlencode($file['name']));?>" data-type="<?php echo ($file['type'] == 'dir')?'dir':'file'?>" data-mime="<?php echo $file['mime']?>" data-size='<?php echo $file['size'];?>'>
                                <td class="filename svg" style="background-image:url(<?php if($file['type'] == 'dir') echo mimetype_icon('dir'); else echo mimetype_icon($file['mime']); ?>)">
                                        <?php if(!isset($_['readonly']) || !$_['readonly']) { ?><input type="checkbox" /><?php } ?>
-                                       <a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$file['directory'].'/'.$file['name']; else echo $_['downloadURL'].urlencode($file['directory']).'/'.urlencode($file['name']); ?>" title="">
+                                       <a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].str_replace('%2F','/',urlencode($file['directory'])).'/'.urlencode($file['name']); else echo $_['downloadURL'].str_replace('%2F','/',urlencode($file['directory'])).'/'.urlencode($file['name']); ?>" title="">
                                        <span class="nametext">
                                                <?php if($file['type'] == 'dir'):?>
                                                        <?php echo htmlspecialchars($file['name']);?>