diff --git a/public/include.php b/public/include.php index 8b229a1..15c06ee 100644 --- a/public/include.php +++ b/public/include.php @@ -12,20 +12,20 @@ LAZY_LOAD: '', encryption: str => window.btoa(unescape(encodeURIComponent(str))), decrypt: str => decodeURIComponent(escape(window.atob(str))), - changeURLArg: function(url, arg, arg_val) { - let pattern = arg + '=([^&]*)' - let replaceText = arg + '=' + arg_val + changeURLArg: (url, arg, arg_val) => { + let pattern = arg + '=([^&]*)'; + let replaceText = arg + '=' + arg_val; if (url.match(pattern)) { - let tmp = '/(' + arg + '=)([^&]*)/gi' - return url.replace(eval(tmp), replaceText) + let tmp = '/(' + arg + '=)([^&]*)/gi'; + return url.replace(eval(tmp), replaceText); } else { if (url.match('[?]')) { - return url + '&' + replaceText + return url + '&' + replaceText; } else { - return url + '?' + replaceText + return url + '?' + replaceText; } } - return url + '\n' + arg + '\n' + arg_val + return url + '\n' + arg + '\n' + arg_val; } }