From 3302305cd4a499603784aa87a40f5170d62a4f26 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Sun, 13 Nov 2011 16:11:32 +0100 Subject: [ticket/9066] Move regex into get_preg_expression function and add tests PHPBB3-9066 --- phpBB/includes/functions.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'phpBB/includes') diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index c2b099d48a..e477b0454e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -3486,6 +3486,10 @@ function get_preg_expression($mode) $inline = ($mode == 'relative_url') ? ')' : ''; return "(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*(?:/(?:[a-z0-9\-._~!$&'($inline*+,;=:@|]+|%[\dA-F]{2})*)*(?:\?(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?(?:\#(?:[a-z0-9\-._~!$&'($inline*+,;=:@/?|]+|%[\dA-F]{2})*)?"; break; + + case 'table_prefix': + return '#^[a-zA-Z][a-zA-Z0-9_]*$#'; + break; } return ''; -- cgit v1.2.1