From c0f64d360fcb410192fa35d6353a2956bcc421c6 Mon Sep 17 00:00:00 2001 From: David M Date: Sat, 23 Dec 2006 17:56:50 +0000 Subject: [PATCH] regex man strikes again! git-svn-id: file:///svn/phpbb/trunk@6794 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/regex.php | 9 ++++----- phpBB/includes/functions.php | 8 ++++---- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php index 4893a3d271..2b736afec2 100644 --- a/phpBB/develop/regex.php +++ b/phpBB/develop/regex.php @@ -43,12 +43,11 @@ echo 'IPv4: ' . $ipv4 . "
\nIPv6: " . $ipv6 . "
\n"; $pct_encoded = "%[\dA-F]{2}"; $unreserved = 'a-z0-9\-._~'; $sub_delims = '!$&\'()*+,;='; -$pchar = "(?:[$unreserved$sub_delims:@|]|$pct_encoded)"; // rfc: no "|" +$pchar = "(?:[$unreserved$sub_delims:@|]+|$pct_encoded)"; // rfc: no "|" $scheme = '[a-z][a-z\d+\-.]*'; -$reg_name = "(?:[$unreserved$sub_delims|]|$pct_encoded)+"; // rfc: * instead of + and no "|" -$authority = "(?:(?:[\w\-.~!$&'()*+,;=:]|$pct_encoded)*@){0,1}(?:$reg_name|$ipv4|\[$ipv6\])[:]?\d*"; -$userinfo = "(?:(?:[$unreserved$sub_delims:]|$pct_encoded))*"; +$reg_name = "(?:[$unreserved$sub_delims|]+|$pct_encoded)+"; // rfc: * instead of + and no "|" +$userinfo = "(?:(?:[$unreserved$sub_delims:]+|$pct_encoded))*"; $ipv4_simple = '[0-9.]+'; $ipv6_simple = '\[[a-z0-9.:]+\]'; $host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; @@ -57,7 +56,7 @@ $authority = "(?:$userinfo@)?$host(?::$port)?"; $segment = "$pchar*"; $path_abempty = "(?:/$segment)*"; $hier_part = "/{2}$authority$path_abempty"; -$query = "(?:[$unreserved$sub_delims:@/?|]|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" +$query = "(?:[$unreserved$sub_delims:@/?|]+|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" $fragment = $query; $url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?"; diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ea05d969a2..323590b269 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2740,7 +2740,7 @@ function get_preg_expression($mode) case 'bbcode_htm': return array( '#.*?#', - '#.*?#', + '#.*?#', '#