From 37c4ca835e2ca685e185178a610778d19d82af9b Mon Sep 17 00:00:00 2001 From: ellynoize <111681973+ellynoize@users.noreply.github.com> Date: Thu, 26 Sep 2024 19:34:05 +0600 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B0=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA=D0=B0?= =?UTF-8?q?=20=D0=BA=D0=BE=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=D1=81?= =?UTF-8?q?=D1=82=D0=B8=20=D0=BA=D0=BB=D1=8E=D1=87=D0=B0=20collector=20(#2?= =?UTF-8?q?26)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ VERSION | 2 +- retailcrm/lib/settings/RetailcrmSettingsValidator.php | 2 +- retailcrm/retailcrm.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd9e427..ff261ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## v3.6.9 +* Добавлена проверка корректности введеного ключа при подключении Daemon Collector + ## v3.6.8 * Исправлен перевод для поля "ИНН" diff --git a/VERSION b/VERSION index 424e179..cff2619 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.6.8 +3.6.9 diff --git a/retailcrm/lib/settings/RetailcrmSettingsValidator.php b/retailcrm/lib/settings/RetailcrmSettingsValidator.php index 36f1082..cc3f1f9 100644 --- a/retailcrm/lib/settings/RetailcrmSettingsValidator.php +++ b/retailcrm/lib/settings/RetailcrmSettingsValidator.php @@ -404,7 +404,7 @@ class RetailcrmSettingsValidator private function validateCollector($collectorActive, $collectorKey) { - return !$collectorActive || '' !== $collectorKey; + return !$collectorActive || preg_match("/^RC-[0-9]{10}-[0-9]{1,2}$/", $collectorKey); } private function addError($field, $message) diff --git a/retailcrm/retailcrm.php b/retailcrm/retailcrm.php index 6eca87e..e3d7d26 100755 --- a/retailcrm/retailcrm.php +++ b/retailcrm/retailcrm.php @@ -48,7 +48,7 @@ require_once dirname(__FILE__) . '/bootstrap.php'; class RetailCRM extends Module { - const VERSION = '3.6.8'; + const VERSION = '3.6.9'; const API_URL = 'RETAILCRM_ADDRESS'; const API_KEY = 'RETAILCRM_API_TOKEN';