aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-12-28 12:47:27 -0500
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-12-28 12:47:27 -0500
commit9b59bf40dff94c79cef45916c7ec6cf7d9835f14 (patch)
tree02e64df3271d9dda4a53848aa405923913336ef3
parent1cddfe8820b37eeca5c814ea9a48ebd3abab23ea (diff)
downloadnextcloud-server-9b59bf40dff94c79cef45916c7ec6cf7d9835f14.tar.gz
nextcloud-server-9b59bf40dff94c79cef45916c7ec6cf7d9835f14.zip
Fix encoding again and update the link after renaming files
-rw-r--r--files/index.php2
-rw-r--r--files/js/filelist.js2
-rw-r--r--files/templates/part.list.php10
3 files changed, 10 insertions, 4 deletions
diff --git a/files/index.php b/files/index.php
index 189917150ad..fc69a42bec6 100644
--- a/files/index.php
+++ b/files/index.php
@@ -71,7 +71,7 @@ $breadcrumb = array();
$pathtohere = "";
foreach( explode( "/", $dir ) as $i ){
if( $i != "" ){
- $pathtohere .= "/".urlencode($i);
+ $pathtohere .= "/".str_replace('+','%20', urlencode($i));
$breadcrumb[] = array( "dir" => $pathtohere, "name" => $i );
}
}
diff --git a/files/js/filelist.js b/files/js/filelist.js
index 16f73ed58d6..c8720d5a435 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -136,6 +136,8 @@ FileList={
var newname=input.val();
tr.attr('data-file',newname);
td.children('a.name').empty();
+ var path = td.children('a.name').attr('href');
+ td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
if(newname.indexOf('.')>0){
basename=newname.substr(0,newname.lastIndexOf('.'));
}else{
diff --git a/files/templates/part.list.php b/files/templates/part.list.php
index 157ec4ef42c..ae3f32b2e9f 100644
--- a/files/templates/part.list.php
+++ b/files/templates/part.list.php
@@ -4,11 +4,15 @@
if($simple_size_color<0) $simple_size_color = 0;
$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('+','%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'];?>'>
+ if($relative_date_color>200) $relative_date_color = 200;
+ $name = str_replace('+','%20',urlencode($file['name']));
+ $name = str_replace('%2F','/', $name);
+ $directory = str_replace('+','%20',urlencode($file['directory']));
+ $directory = str_replace('%2F','/', $directory); ?>
+ <tr data-file="<?php echo $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'].str_replace('%2F','/',urlencode($file['directory'])).'/'.urlencode($file['name']); else echo $_['downloadURL'].str_replace('%2F','/',urlencode($file['directory'])).'/'.urlencode($file['name']); ?>" title="">
+ <a class="name" href="<?php if($file['type'] == 'dir') echo $_['baseURL'].$directory.'/'.$name; else echo $_['downloadURL'].$directory.'/'.$name; ?>" title="">
<span class="nametext">
<?php if($file['type'] == 'dir'):?>
<?php echo htmlspecialchars($file['name']);?>