From e2b73513f4b323d96f4b9fa0cf4a06a057666750 Mon Sep 17 00:00:00 2001 From: panxiaoming Date: Wed, 28 Nov 2012 10:09:55 +0800 Subject: [PATCH] fixed the bug of URIDECODE error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit if link to a chinese file name, it will jump to error page; for example, the chinese file name called "消息文档.md", when after urlencode, it will be "%E6%B6%88%E6%81%AF%E6%96%87%E6%A1%A3.md", but after use History.pushState, will jump to a bad decode link. --- app/assets/javascripts/tree.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/tree.js.coffee b/app/assets/javascripts/tree.js.coffee index 3f8ed6c2..5003f9b0 100644 --- a/app/assets/javascripts/tree.js.coffee +++ b/app/assets/javascripts/tree.js.coffee @@ -28,7 +28,7 @@ $ -> return false $('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live 'click', (e) -> - History.pushState(null, null, $(@).attr('href')) + History.pushState(null, null, decodeURIComponent($(@).attr('href'))) return false History.Adapter.bind window, 'statechange', ->