From 0bb3d57b26e3e1685d6542bdce2842bc7e171807 Mon Sep 17 00:00:00 2001 From: "Ilya Ig. Petrov" Date: Sun, 5 Mar 2017 13:21:35 +0000 Subject: [PATCH] Reject empty own proxies --- .../pages/choose-pac-provider/index.js | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/choose-pac-provider/index.js b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/choose-pac-provider/index.js index 214e610..6558faf 100644 --- a/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/choose-pac-provider/index.js +++ b/extensions/chromium/runet-censorship-bypass/src/extension-common/pages/choose-pac-provider/index.js @@ -581,16 +581,16 @@ HTTPS 11.22.33.44:8080;">${conf.value || localStorage.getItem(uiRaw) || ''} str ) - .every( - (str) => - /^(?:DIRECT|(?:(?:HTTPS?|PROXY|SOCKS(?:4|5)?)\s+\S+))$/g - .test(str) - ); - if (!ifValid) { + .filter( (str) => str ); + const ifValid = ifValidArr.every( + (str) => + /^(?:DIRECT|(?:(?:HTTPS?|PROXY|SOCKS(?:4|5)?)\s+\S+))$/g + .test(str) + ); + if (!(ifValidArr.length && ifValid)) { return showErrors(new TypeError( 'Неверный формат своих прокси. Свертесь с документацией.' ));