瀏覽代碼

fix ips and domain validations

Olivier Massot 5 年之前
父節點
當前提交
4d9370b1c2

+ 5 - 1
ot_admin/Classes/Http/ApiController.php

@@ -17,7 +17,11 @@ class ApiController implements LoggerAwareInterface
     const ALLOWED_IPS = [
     const ALLOWED_IPS = [
         '/^127\.0\.0\.[0-1]$/',
         '/^127\.0\.0\.[0-1]$/',
         '/^localhost$/',
         '/^localhost$/',
-        '/^10\.8\.0\.\d{1,3}$/'
+        '/^10\.8\.0\.\d{1,3}$/',
+        '/^80\.245\.24\.68$/',   // prod-front
+        '/^80\.245\.24\.70$/',   // prod-back
+        '/^80\.245\.24\.72$/',   // test
+        '/^80\.245\.24\.74$/'    // preprod
     ];
     ];
 
 
     /**
     /**

+ 1 - 1
ot_stats/Classes/Domain/Repository/MatomoWebsiteRepository.php

@@ -22,7 +22,7 @@ class MatomoWebsiteRepository
      * Regex
      * Regex
      */
      */
     const RELATIVE_PATH_VALIDATION = '/^\/[a-zA-Z0-9_\-]+\/?$/';
     const RELATIVE_PATH_VALIDATION = '/^\/[a-zA-Z0-9_\-]+\/?$/';
-    const DOMAIN_VALIDATION = '/^(https?:\/\/)?([a-zA-Z0-9]+\.)+[a-zA-Z]{2,}(:\d+)?(\/[a-zA-Z0-9_\-]+)*\/?$/';
+    const DOMAIN_VALIDATION = "/^(https?:\/\/)?([\w-]+\.)+[a-zA-Z]{2,}(:\d+)?(\/[a-zA-Z0-9_\-]+)*\/?$/";
 
 
     /**
     /**
      * Connection to the matomo DB
      * Connection to the matomo DB