]> git.mxchange.org Git - hub.git/commitdiff
Completely replaced regex for detecting ip:port combinations
authorRoland Häder <roland@mxchange.org>
Thu, 31 Mar 2011 01:45:51 +0000 (01:45 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 31 Mar 2011 01:45:51 +0000 (01:45 +0000)
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