]> git.mxchange.org Git - hub.git/blobdiff - application/hub/main/tools/class_HubTools.php
Completely replaced regex for detecting ip:port combinations
[hub.git] / application / hub / main / tools / class_HubTools.php
index 95e1b78315b0dca753e082603a7286f3823bc9e2..5426c0b7c6066a51b3309f89d7cfc45a9a0d354d 100644 (file)
@@ -112,7 +112,7 @@ class HubTools extends BaseFrameworkSystem {
                $recipient = $sessionId;
 
                // Does it match a direct ip:port? (hint: see www.regexlib.com for the regular expression)
-               if (!preg_match('/((?:2[0-5]{2}|1\d{2}|[1-9]\d|[1-9])\.(?:(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)\.){2}(?:2[0-5]{2}|1\d{2}|[1-9]\d|\d)):(\d|[1-9]\d|[1-9]\d{2,3}|[1-5]\d{4}|6[0-4]\d{3}|654\d{2}|655[0-2]\d|6553[0-5])/', $sessionId)) {
+               if (!preg_match('/((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])):([0-9]{3,5})/', $sessionId)) {
                        // Is it in cache?
                        if (isset($selfInstance->sessionIdCache[$sessionId])) {
                                // Debug message