diff --git a/javascript/SiteTreeURLSegmentField.js b/javascript/SiteTreeURLSegmentField.js index 450612cb..4b671178 100644 --- a/javascript/SiteTreeURLSegmentField.js +++ b/javascript/SiteTreeURLSegmentField.js @@ -24,7 +24,7 @@ redraw: function() { var field = this.find(':text'), - url = field.data('prefix') + field.val(), + url = decodeURI(field.data('prefix') + field.val()), previewUrl = url; // Truncate URL if required (ignoring the suffix, retaining the full value) @@ -33,7 +33,7 @@ } // Transfer current value to holder - this.find('.preview').attr('href', url + field.data('suffix')).text(previewUrl); + this.find('.preview').attr('href', encodeURI(url + field.data('suffix'))).text(previewUrl); }, /**