fix #1830 (in URLs, encode slashes in edit/text titles)
This commit is contained in:
parent
c1cf48852b
commit
d524d16508
1 changed files with 3 additions and 4 deletions
|
@ -532,7 +532,7 @@ Ox.URL = function(options) {
|
||||||
parts.push(state.type);
|
parts.push(state.type);
|
||||||
}
|
}
|
||||||
if (state.item) {
|
if (state.item) {
|
||||||
parts.push(encodeValue(state.item));
|
parts.push(encodeValue(state.item, true));
|
||||||
}
|
}
|
||||||
if (state.type && self.options.views[state.type][
|
if (state.type && self.options.views[state.type][
|
||||||
state.item ? 'item' : 'list'
|
state.item ? 'item' : 'list'
|
||||||
|
@ -566,9 +566,8 @@ Ox.URL = function(options) {
|
||||||
return Ox.decodeURIComponent(value).replace(/_/g, ' ').replace(Ox.char(9), '_');
|
return Ox.decodeURIComponent(value).replace(/_/g, ' ').replace(Ox.char(9), '_');
|
||||||
}
|
}
|
||||||
|
|
||||||
function encodeValue(value) {
|
function encodeValue(value, encodeSlash) {
|
||||||
// var chars = '/&|()=*:';
|
var chars = (encodeSlash ? '/' : '') + '&|()=*%',
|
||||||
var chars = '&|()=*%',
|
|
||||||
ret = '';
|
ret = '';
|
||||||
value.toString().split('').forEach(function(char) {
|
value.toString().split('').forEach(function(char) {
|
||||||
var index = chars.indexOf(char);
|
var index = chars.indexOf(char);
|
||||||
|
|
Loading…
Reference in a new issue