From a6ec6dff8d3abb429557c8c0b6e30c50885afed3 Mon Sep 17 00:00:00 2001 From: pdontthink Date: Sat, 1 Aug 2009 19:15:13 +0000 Subject: [PATCH] Fix broken regular expression git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13808 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- functions/url_parser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/url_parser.php b/functions/url_parser.php index 73ef9843..3d82192c 100644 --- a/functions/url_parser.php +++ b/functions/url_parser.php @@ -35,10 +35,12 @@ function replaceBlock (&$in, $replace, $start, $end) { */ /* Here's enough: */ global $IP_RegExp_Match, $Host_RegExp_Match, $Email_RegExp_Match; +//FIXME: these were written for use in an ereg().... they are now being used in preg()... we need to run some tests to make sure they are fully working still $IP_RegExp_Match = '\\[?[0-9]{1,3}(\\.[0-9]{1,3}){3}\\]?'; $Host_RegExp_Match = '(' . $IP_RegExp_Match . '|[0-9a-z]([-.]?[0-9a-z])*\\.[a-z][a-z]+)'; -$atext = '([a-z0-9!#$&%*+/=?^_`{|}~-]|&)'; +// NB: the backslash in the following line escapes the forward slash, which assumes that the regular expression will be enclosed in /.../ +$atext = '([a-z0-9!#$&%*+\/=?^_`{|}~-]|&)'; $dot_atom = $atext . '+(\.' . $atext . '+)*'; $Email_RegExp_Match = $dot_atom . '(%' . $Host_RegExp_Match . ')?@' . $Host_RegExp_Match; -- 2.25.1