1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 05:50:42 +02:00

[ticket/9066] Move regex into get_preg_expression function and add tests

PHPBB3-9066
This commit is contained in:
Joas Schilling
2011-11-13 16:11:32 +01:00
parent 6370ef2705
commit 3302305cd4
3 changed files with 40 additions and 1 deletions

View File

@@ -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 '';