Browse Source

fix reserved subdomains regex

Olivier Massot 5 tháng trước cách đây
mục cha
commit
41859eb585
1 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 2 2
      src/Service/Typo3/SubdomainService.php

+ 2 - 2
src/Service/Typo3/SubdomainService.php

@@ -77,11 +77,11 @@ class SubdomainService
     {
         $reservedSubdomains = $this->parameterBag->get('opentalent.subdomains')['reserved'];
         $subRegexes = array_map(
-            function (string $s) { return '(\b'.trim($s, '^$/\s').'\b)'; },
+            function (string $s) { return '(\b'.trim($s).'\b)'; },
             $reservedSubdomains
         );
 
-        $regex = '/^'.strtolower(implode('|', $subRegexes)).'$/';
+        $regex = '/^(?:'.strtolower(implode('|', $subRegexes)).')$/';
 
         return preg_match($regex, $subdomainValue) !== 0;
     }