diff options
| author | Marc Alexander <admin@m-a-styles.de> | 2019-11-01 22:01:26 +0100 |
|---|---|---|
| committer | Marc Alexander <admin@m-a-styles.de> | 2019-11-01 22:01:26 +0100 |
| commit | 912eb28223c937a679bd2c78ea139033f7796b26 (patch) | |
| tree | d7b119bb5627d0814a0177070bf12ba15c939f15 /phpBB/develop/regex.php | |
| parent | ce35aa8b0b90870608a5b0782a36c6aedad8c7e4 (diff) | |
| parent | 00682db8a625e40f720c513c72267395c4354766 (diff) | |
| download | forums-912eb28223c937a679bd2c78ea139033f7796b26.tar forums-912eb28223c937a679bd2c78ea139033f7796b26.tar.gz forums-912eb28223c937a679bd2c78ea139033f7796b26.tar.bz2 forums-912eb28223c937a679bd2c78ea139033f7796b26.tar.xz forums-912eb28223c937a679bd2c78ea139033f7796b26.zip | |
Merge pull request #5718 from rubencm/ticket/16189
[ticket/16189] Deprecate inet_ntop and inet_pton wrappers
Diffstat (limited to 'phpBB/develop/regex.php')
| -rw-r--r-- | phpBB/develop/regex.php | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 46b6fff701..77c6d5c0e6 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -8,46 +8,6 @@ // die("Please read the first lines of this script for instructions on how to enable it"); - -// IP regular expressions - -$dec_octet = '(?:\d{1,2}|1\d\d|2[0-4]\d|25[0-5])'; -$h16 = '[\dA-F]{1,4}'; -$ipv4 = "(?:$dec_octet\.){3}$dec_octet"; -$ls32 = "(?:$h16:$h16|$ipv4)"; - -$ipv6_construct = array( - array(false, '', '{6}', $ls32), - array(false, '::', '{0,5}', "(?:$h16(?::$h16)?|$ipv4)"), - array('', ':', '{4}', $ls32), - array('{1,2}', ':', '{3}', $ls32), - array('{1,3}', ':', '{2}', $ls32), - array('{1,4}', ':', '', $ls32), - array('{1,5}', ':', false, $ls32), - array('{1,6}', ':', false, $h16), - array('{1,7}', ':', false, ''), - array(false, '::', false, '') -); - -$ipv6 = '(?:'; -foreach ($ipv6_construct as $ip_type) -{ - $ipv6 .= '(?:'; - if ($ip_type[0] !== false) - { - $ipv6 .= "(?:$h16:)" . $ip_type[0]; - } - $ipv6 .= $ip_type[1]; - if ($ip_type[2] !== false) - { - $ipv6 .= "(?:$h16:)" . $ip_type[2]; - } - $ipv6 .= $ip_type[3] . ')|'; -} -$ipv6 = substr($ipv6, 0, -1) . ')'; - -echo 'IPv4: ' . $ipv4 . "<br />\nIPv6: " . $ipv6 . "<br />\n"; - // URL regular expressions $pct_encoded = "%[\dA-F]{2}"; |
