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:
Kevin Röbert
2018-06-25 21:58:07 +02:00
parent d51b49b40c
commit e001144d1a
2 changed files with 8 additions and 2 deletions

View File

@@ -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;