From f4f981d8f98e4f74a8d69d05a31ab63e188ea808 Mon Sep 17 00:00:00 2001 From: Till Brehm <tbrehm@ispconfig.org> Date: Sun, 15 Nov 2015 08:00:17 -0500 Subject: [PATCH] Added missing delimiter settings in reseller form file. --- interface/lib/classes/functions.inc.php | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/interface/lib/classes/functions.inc.php b/interface/lib/classes/functions.inc.php index 43eec67..8ec4496 100644 --- a/interface/lib/classes/functions.inc.php +++ b/interface/lib/classes/functions.inc.php @@ -186,7 +186,8 @@ 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"; @@ -301,7 +302,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> @@ -318,7 +319,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