summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-11-16 12:58:24 +0100
committerMichael Gapczynski <mtgap@owncloud.com>2012-12-21 10:28:50 -0500
commit68c020004bcaf49b00641ecae1e4c5d73e9193cd (patch)
tree8740e4ccd5595c4eb7f523b3b08160bf23d94bc8 /apps
parent81d9ba8045c9281ec67e0b31b29964d672ce48b0 (diff)
downloadnextcloud-server-68c020004bcaf49b00641ecae1e4c5d73e9193cd.tar.gz
nextcloud-server-68c020004bcaf49b00641ecae1e4c5d73e9193cd.zip
Do the url encoding once, only in breadcrumbs template
fixes issue #438 Conflicts: apps/files/index.php apps/files/templates/part.breadcrumb.php
Diffstat (limited to 'apps')
-rw-r--r--apps/files/ajax/list.php2
-rw-r--r--apps/files/index.php4
-rw-r--r--apps/files/templates/part.breadcrumb.php7
3 files changed, 7 insertions, 6 deletions
diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php
index 568fe754c02..cade7e872b3 100644
--- a/apps/files/ajax/list.php
+++ b/apps/files/ajax/list.php
@@ -25,7 +25,7 @@ if($doBreadcrumb) {
}
$breadcrumbNav = new OCP\Template( "files", "part.breadcrumb", "" );
- $breadcrumbNav->assign( "breadcrumb", $breadcrumb );
+ $breadcrumbNav->assign( "breadcrumb", $breadcrumb, false );
$data['breadcrumb'] = $breadcrumbNav->fetchPage();
}
diff --git a/apps/files/index.php b/apps/files/index.php
index 240fc029fcc..1e28a43072a 100644
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -36,7 +36,7 @@ if(!isset($_SESSION['timezone'])) {
}
OCP\App::setActiveNavigationEntry( 'files_index' );
// Load the files
-$dir = isset( $_GET['dir'] ) ? urldecode(stripslashes($_GET['dir'])) : '';
+$dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : '';
// Redirect if directory does not exist
if(!OC_Filesystem::is_dir($dir.'/')) {
header('Location: '.$_SERVER['SCRIPT_NAME'].'');
@@ -67,7 +67,7 @@ $breadcrumb = array();
$pathtohere = '';
foreach( explode( '/', $dir ) as $i ) {
if( $i != '' ) {
- $pathtohere .= '/'.str_replace('+','%20', urlencode($i));
+ $pathtohere .= '/'.$i;
$breadcrumb[] = array( 'dir' => $pathtohere, 'name' => $i );
}
}
diff --git a/apps/files/templates/part.breadcrumb.php b/apps/files/templates/part.breadcrumb.php
index 71b695f65f8..ba1432c1b8f 100644
--- a/apps/files/templates/part.breadcrumb.php
+++ b/apps/files/templates/part.breadcrumb.php
@@ -1,6 +1,7 @@
<?php for($i=0; $i<count($_["breadcrumb"]); $i++):
- $crumb = $_["breadcrumb"][$i]; ?>
- <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo urlencode($crumb["dir"]);?>' style='background-image:url("<?php echo OCP\image_path('core','breadcrumb.png');?>")'>
- <a href="<?php echo $_['baseURL'].urlencode($crumb["dir"]); ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
+ $crumb = $_["breadcrumb"][$i];
+ $dir = str_replace('+','%20', urlencode($crumb["dir"])); ?>
+ <div class="crumb <?php if($i == count($_["breadcrumb"])-1) echo 'last';?> svg" data-dir='<?php echo $dir;?>' style='background-image:url("<?php echo OCP\image_path('core', 'breadcrumb.png');?>")'>
+ <a href="<?php echo $_['baseURL'].$dir; ?>"><?php echo OCP\Util::sanitizeHTML($crumb["name"]); ?></a>
</div>
<?php endfor;?>