mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Fix gh-2160: Search with % (#2161)
* Fixed turning '+' into ' ' * Fixed issue 2160 * Added space before '{'
This commit is contained in:
parent
1ae8180aa4
commit
24d07f6139
1 changed files with 6 additions and 1 deletions
|
@ -78,7 +78,12 @@ class Search extends React.Component {
|
|||
while (term.indexOf('&') > -1) {
|
||||
term = term.substring(0, term.indexOf('&'));
|
||||
}
|
||||
term = decodeURIComponent(term.split('+').join(' '));
|
||||
try {
|
||||
term = decodeURIComponent(term);
|
||||
} catch (e) {
|
||||
// Error means that term was not URI encoded and decoding failed.
|
||||
// We can silence this error because not all query strings are intended to be decoded.
|
||||
}
|
||||
this.props.dispatch(navigationActions.setSearchTerm(term));
|
||||
}
|
||||
componentDidUpdate (prevProps) {
|
||||
|
|
Loading…
Reference in a new issue