From 5ca959fa688255a8de61f89fe2751eb4d24a6912 Mon Sep 17 00:00:00 2001 From: Florian Schaal <florian@schaal-24.de> Date: Tue, 22 Mar 2016 09:22:07 -0400 Subject: [PATCH] fixed typo --- server/lib/classes/functions.inc.php | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/server/lib/classes/functions.inc.php b/server/lib/classes/functions.inc.php index be55503..6a46d5e 100644 --- a/server/lib/classes/functions.inc.php +++ b/server/lib/classes/functions.inc.php @@ -230,14 +230,15 @@ global $app; if($type == 'IPv4'){ - $regex = "/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/"; +// $regex = "/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/"; + $regex = "/^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/"; } else { // IPv6 $regex = "/^(\:\:([a-f0-9]{1,4}\:){0,6}?[a-f0-9]{0,4}|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){0,6}?\:\:|[a-f0-9]{1,4}(\:[a-f0-9]{1,4}){1,6}?\:\:([a-f0-9]{1,4}\:){1,6}?[a-f0-9]{1,4})(\/\d{1,3})?$/i"; } $ips = array(); - $results = $app->db->queryAllRecords("SELECT ip_address AS ip FROM server_ip WHERE ip_type = '".$type."'"); + $results = $app->db->queryAllRecords("SELECT ip_address AS ip FROM server_ip WHERE ip_type = ?", $type); if(!empty($results) && is_array($results)){ foreach($results as $result){ if(preg_match($regex, $result['ip'])) $ips[] = $result['ip']; @@ -353,7 +354,7 @@ if($encode == true) { if(function_exists('idn_to_ascii')) { - $domain = idn_to_ascii($domain); + $domain = idn_to_ascii($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); } elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) { /* use idna class: * @author Matthias Sommerfeld <mso@phlylabs.de> @@ -370,7 +371,7 @@ } } else { if(function_exists('idn_to_utf8')) { - $domain = idn_to_utf8($domain); + $domain = idn_to_utf8($domain, IDNA_NONTRANSITIONAL_TO_ASCII, INTL_IDNA_VARIANT_UTS46); } elseif(file_exists(ISPC_CLASS_PATH.'/idn/idna_convert.class.php')) { /* use idna class: * @author Matthias Sommerfeld <mso@phlylabs.de> -- Gitblit v1.9.1