url: `search?q=ben%27s` if `query` has an apostrophe in it, this breaks, for example: ``` query => ?q=ben%27s queryRegExp => \?q=ben%27s ``` ``` // Add the query string, if not already present if (query && !fragment.match(queryRegExp)) { fragment += query; } ``` This passes the test above and leads to fragment being doubled over, returning: ``` fragment => search?q=ben's?q=ben%27s ``` You should decode the query before crafting a regex: ``` decodeURIComponent(query).replace(escapeRegExp, '\\$&'); ```
Activity