Merge "Double-encode search query"
This commit is contained in:
@@ -54,7 +54,8 @@
|
|||||||
_preventDefaultAndNavigateToInputVal: function(e) {
|
_preventDefaultAndNavigateToInputVal: function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
Polymer.dom(e).rootTarget.blur();
|
Polymer.dom(e).rootTarget.blur();
|
||||||
page.show('/q/' + this._inputVal);
|
// @see Issue 4255.
|
||||||
|
page.show('/q/' + encodeURIComponent(encodeURIComponent(this._inputVal)));
|
||||||
},
|
},
|
||||||
|
|
||||||
_handleKey: function(e) {
|
_handleKey: function(e) {
|
||||||
|
@@ -71,5 +71,12 @@ limitations under the License.
|
|||||||
MockInteractions.pressAndReleaseKeyOn(element.$.searchInput, 13);
|
MockInteractions.pressAndReleaseKeyOn(element.$.searchInput, 13);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('search query should be double-escaped', function() {
|
||||||
|
var showStub = sinon.stub(page, 'show');
|
||||||
|
element._inputVal = 'fate/stay';
|
||||||
|
MockInteractions.pressAndReleaseKeyOn(element.$.searchInput, 13);
|
||||||
|
assert.equal(showStub.lastCall.args[0], '/q/fate%252Fstay');
|
||||||
|
showStub.restore();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Reference in New Issue
Block a user