Updated referralMarketing pattern to match rule pattern

This commit is contained in:
Kevin R 2021-01-13 16:32:57 +01:00
parent 9ba19a9eb3
commit 4f6241842f
No known key found for this signature in database
GPG Key ID: 97471F65F14A4C66

View File

@ -1,6 +1,6 @@
/*
* ClearURLs
* Copyright (c) 2017-2020 Kevin Röbert
* Copyright (c) 2017-2021 Kevin Röbert
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@ -52,7 +52,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false, request = null) {
"changes": false,
"url": url,
"cancel": false
};
}
}
/*
@ -93,12 +93,12 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false, request = null) {
pushToLog(pureUrl, url, translate('log_redirect'));
increaseGlobalURLCounter(1);
increaseBadged(false, request)
};
}
return {
"redirect": true,
"url": url
};
}
}
if (existsFields(url)) {
@ -157,7 +157,7 @@ function removeFieldsFormURL(provider, pureUrl, quiet = false, request = null) {
"changes": changes,
"url": url,
"cancel": cancel
};
}
}
function start() {
@ -255,7 +255,7 @@ function start() {
return {
hash: (await response.text()).trim(),
status: response.status
};
}
});
response.then(result => {
@ -290,7 +290,7 @@ function start() {
data: (await response.clone().text()).trim(),
hash: await sha256((await response.text()).trim()),
status: response.status
};
}
})
response.then(result => {
@ -468,7 +468,7 @@ function start() {
* @param {boolean} isActive Is this rule active?
*/
this.addReferralMarketing = function (rule, isActive = true) {
rule = "([\\/\\?#]|(&|&))+(" + rule + "=[^\\/\\?&]*)";
rule = "([\\/\\?#]|(&|&))+(" + rule + "=[^&]*)";
this.applyRule(enabled_referralMarketing, disabled_referralMarketing, rule, isActive);
};
@ -478,7 +478,7 @@ function start() {
* and replace old with new exception.
*
* @param {String} exception RegExp as string
* @param {Boolean} isActive Is this exception acitve?
* @param {Boolean} isActive Is this exception active?
*/
this.addException = function (exception, isActive = true) {
if (isActive) {