From 85dde60c614fcecca6ea2f1d49ffa03cd4655cd3 Mon Sep 17 00:00:00 2001 From: John Campbell Date: Wed, 18 Apr 2018 12:30:16 -0400 Subject: [PATCH] fixing issue with spaces... window.location.hash comes in as encoded --- index.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 57324a1..12bf4da 100644 --- a/index.php +++ b/index.php @@ -285,7 +285,7 @@ $(function(){ }); $('#mkdir').submit(function(e) { - var hashval = window.location.hash.substr(1), + var hashval = decodeURIComponent(window.location.hash.substr(1)), $dir = $(this).find('[name=name]'); e.preventDefault(); $dir.val().length && $.post('?',{'do':'mkdir',name:$dir.val(),xsrf:XSRF,file:hashval},function(data){ @@ -319,7 +319,7 @@ $(function(){ function uploadFile(file) { - var folder = window.location.hash.substr(1); + var folder = decodeURIComponent(window.location.hash.substr(1)); if(file.size > MAX_UPLOAD_SIZE) { var $error_row = renderFileSizeErrorRow(file,folder); @@ -363,7 +363,6 @@ $(function(){ function list() { var hashval = window.location.hash.substr(1); - console.log(hashval); $.get('?do=list&file='+ hashval,function(data) { $tbody.empty(); $('#breadcrumb').empty().html(renderBreadcrumbs(hashval));