Skip to content

Commit 284fcdb

Browse files
committed
encode uri component for elem value
1 parent 42c1597 commit 284fcdb

File tree

1 file changed

+2
-2
lines changed
  • samples/nounly/public/javascripts

1 file changed

+2
-2
lines changed

samples/nounly/public/javascripts/app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
if (t != 0)
2424
submitting();
2525
if (t == 1) {
26-
window.location.href = elem.value;
27-
var item = {code:elem.value, url:window.location.protocol+"//"+window.location.host+"/"+elem.value};
26+
window.location.href = encodeURIComponent(elem.value);
27+
var item = {code: elem.value, url: window.location.protocol + "//" + window.location.host + "/" + encodeURIComponent(elem.value)};
2828
addHistory(history.find(function(e){return e.code === item.code}) || item, true);
2929
}
3030
return t == 2;

0 commit comments

Comments
 (0)