From: Roland Häder Date: Thu, 31 Mar 2011 01:45:51 +0000 (+0000) Subject: Completely replaced regex for detecting ip:port combinations X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f13681ee214e3d262d6df3b51f1409b0226afa52;p=hub.git Completely replaced regex for detecting ip:port combinations --- diff --git a/application/hub/main/tools/class_HubTools.php b/application/hub/main/tools/class_HubTools.php index 95e1b7831..5426c0b7c 100644 --- a/application/hub/main/tools/class_HubTools.php +++ b/application/hub/main/tools/class_HubTools.php @@ -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