[feladat @ 268]
authorrejo
Tue, 13 May 2008 21:35:17 +0000
changeset 162 e109f389316c
parent 161 0832d846bf8e
child 163 32d4c63c50c9
[feladat @ 268] Added two missing exclamation marks in IP address verification function. Closes #52.
inc/dns.inc.php
--- a/inc/dns.inc.php	Tue May 13 20:59:32 2008 +0000
+++ b/inc/dns.inc.php	Tue May 13 21:35:17 2008 +0000
@@ -151,7 +151,7 @@
 //		error(ERR_DNS_IPV4); return false;
 //	}
 
-	if (preg_match("/^[0-9\.]{7,15}$/", $ipv4)) {
+	if (!preg_match("/^[0-9\.]{7,15}$/", $ipv4)) {
 		error(ERR_DNS_IPV4); return false;
 	}
 
@@ -181,7 +181,7 @@
 //		error(ERR_DNS_IPV6); return false;
 //	}
 
-	if (preg_match("/^[0-9a-f]{0,4}:([0-9a-f]{0,4}:){0,6}[0-9a-f]{0,4}$/i", $ipv6)) {
+	if (!preg_match("/^[0-9a-f]{0,4}:([0-9a-f]{0,4}:){0,6}[0-9a-f]{0,4}$/i", $ipv6)) {
 		error(ERR_DNS_IPV6); return false;
 	}