From d524d165087ec76de8b203c692724bfe79ca5a96 Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Mon, 26 Aug 2013 15:32:03 +0000 Subject: [PATCH] fix #1830 (in URLs, encode slashes in edit/text titles) --- source/Ox.UI/js/Core/URL.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/Ox.UI/js/Core/URL.js b/source/Ox.UI/js/Core/URL.js index cce6b91c..0d60e02f 100644 --- a/source/Ox.UI/js/Core/URL.js +++ b/source/Ox.UI/js/Core/URL.js @@ -532,7 +532,7 @@ Ox.URL = function(options) { parts.push(state.type); } if (state.item) { - parts.push(encodeValue(state.item)); + parts.push(encodeValue(state.item, true)); } if (state.type && self.options.views[state.type][ state.item ? 'item' : 'list' @@ -566,9 +566,8 @@ Ox.URL = function(options) { return Ox.decodeURIComponent(value).replace(/_/g, ' ').replace(Ox.char(9), '_'); } - function encodeValue(value) { - // var chars = '/&|()=*:'; - var chars = '&|()=*%', + function encodeValue(value, encodeSlash) { + var chars = (encodeSlash ? '/' : '') + '&|()=*%', ret = ''; value.toString().split('').forEach(function(char) { var index = chars.indexOf(char);