mirror of
https://gitlab.com/KevinRoebert/ClearUrls
synced 2025-12-16 06:05:37 +07:00
Core fix #71
The splitt function for the fields was a greedy function and splitt at the last question mark, but it should splitt at the last question mark. So now the splitt function is a non-greedy function.
This commit is contained in:
@@ -364,7 +364,13 @@ function start(items)
|
||||
*/
|
||||
if(existsFields(url))
|
||||
{
|
||||
fields = url.replace(new RegExp(".*\\?", "i"), "");
|
||||
/**
|
||||
* It must be non-greedy, because by default .* will match
|
||||
* all ? chars. So the replace function delete everything
|
||||
* before the last ?. With adding a ? on the quantifier *,
|
||||
* we fixed this problem.
|
||||
*/
|
||||
fields = url.replace(new RegExp(".*?\\?", "i"), "");
|
||||
|
||||
for (var i = 0; i < rules.length; i++) {
|
||||
var beforReplace = fields;
|
||||
|
||||
Reference in New Issue
Block a user