mirror of
https://github.com/anticensority/runet-censorship-bypass.git
synced 2024-11-24 02:13:43 +03:00
Reject empty own proxies
This commit is contained in:
parent
182a443cc4
commit
0bb3d57b26
|
@ -581,16 +581,16 @@ HTTPS 11.22.33.44:8080;">${conf.value || localStorage.getItem(uiRaw) || ''}</tex
|
|||
|
||||
const taVal = liPs.querySelector('textarea').value;
|
||||
if (oldMods[customProxyStringKey] !== false) {
|
||||
const ifValid = taVal
|
||||
const ifValidArr = taVal
|
||||
.replace(/#.*$/mg)
|
||||
.split(/\s*[;\n\r]+\s*/g)
|
||||
.filter( (str) => str )
|
||||
.every(
|
||||
.filter( (str) => str );
|
||||
const ifValid = ifValidArr.every(
|
||||
(str) =>
|
||||
/^(?:DIRECT|(?:(?:HTTPS?|PROXY|SOCKS(?:4|5)?)\s+\S+))$/g
|
||||
.test(str)
|
||||
);
|
||||
if (!ifValid) {
|
||||
if (!(ifValidArr.length && ifValid)) {
|
||||
return showErrors(new TypeError(
|
||||
'Неверный формат своих прокси. Свертесь с <a href="https://rebrand.ly/ac-own-proxy" data-in-bg="true">документацией</a>.'
|
||||
));
|
||||
|
|
Loading…
Reference in New Issue
Block a user