From 1e34820cd87837b545b310022ee460803d8c5b54 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sat, 16 Dec 2006 20:24:34 +0000 Subject: - Optimize acl_getf_global a bit - a little performance improvement of the IP regular expressions - convert post_text/subject collation to utf8_unicode_ci if a user wants to use mysql_fulltext to allow case insensitivity [Bug #6272] - mysql_fulltext should alter all necessary columns at once to speed up the process - validate URLs against RFC3986 - fixed some weirdness in make_clickable I hope I didn't break any URLs with this commit, if I did then report it to the bugtracker please! git-svn-id: file:///svn/phpbb/trunk@6774 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/develop/ip_regex.php | 37 ----------------------- phpBB/develop/regex.php | 74 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 37 deletions(-) delete mode 100644 phpBB/develop/ip_regex.php create mode 100644 phpBB/develop/regex.php (limited to 'phpBB/develop') diff --git a/phpBB/develop/ip_regex.php b/phpBB/develop/ip_regex.php deleted file mode 100644 index 4e7aaf0156..0000000000 --- a/phpBB/develop/ip_regex.php +++ /dev/null @@ -1,37 +0,0 @@ -\nIPv6: " . $ipv6; -?> \ No newline at end of file diff --git a/phpBB/develop/regex.php b/phpBB/develop/regex.php new file mode 100644 index 0000000000..4893a3d271 --- /dev/null +++ b/phpBB/develop/regex.php @@ -0,0 +1,74 @@ +\nIPv6: " . $ipv6 . "
\n"; + +// URL regular expressions + +$pct_encoded = "%[\dA-F]{2}"; +$unreserved = 'a-z0-9\-._~'; +$sub_delims = '!$&\'()*+,;='; +$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))*"; +$ipv4_simple = '[0-9.]+'; +$ipv6_simple = '\[[a-z0-9.:]+\]'; +$host = "(?:$reg_name|$ipv4_simple|$ipv6_simple)"; +$port = '\d*'; +$authority = "(?:$userinfo@)?$host(?::$port)?"; +$segment = "$pchar*"; +$path_abempty = "(?:/$segment)*"; +$hier_part = "/{2}$authority$path_abempty"; +$query = "(?:[$unreserved$sub_delims:@/?|]|$pct_encoded)*"; // pchar | "/" | "?", rfc: no "|" +$fragment = $query; + +$url = "$scheme:$hier_part(?:\?$query)?(?:\#$fragment)?"; +echo 'URL: ' . $url . "
\n"; + +// no scheme, shortened authority, but host has to start with www. +$www_url = "www\.$reg_name(?::$port)?$path_abempty(?:\?$query)?(?:\#$fragment)?"; +echo 'www.URL: ' . $www_url . "
\n"; + +// no schema and no authority +$relative_url = "$segment$path_abempty(?:\?$query)?(?:\#$fragment)?"; +echo 'relative URL: ' . $relative_url . "
\n"; + +?> \ No newline at end of file -- cgit v1.2.1