From 20c24f234f832b326d935b59d1f6c1fa5f854313 Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Fri, 16 Nov 2012 12:58:24 +0100 Subject: [PATCH] Do the url encoding once, only in breadcrumbs template fixes issue #438 --- apps/files/ajax/list.php | 2 +- apps/files/index.php | 4 ++-- apps/files/templates/part.breadcrumb.php | 7 ++++--- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/apps/files/ajax/list.php b/apps/files/ajax/list.php index 568fe754c0..cade7e872b 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 74332a439f..5e644a2a3b 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'] ) ? rawurldecode(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 ead9ab1ed7..ba1432c1b8 100644 --- a/apps/files/templates/part.breadcrumb.php +++ b/apps/files/templates/part.breadcrumb.php @@ -1,6 +1,7 @@ -
svg" data-dir='' style='background-image:url("")'> - "> + $crumb = $_["breadcrumb"][$i]; + $dir = str_replace('+','%20', urlencode($crumb["dir"])); ?> +
svg" data-dir='' style='background-image:url("")'> +