From: pdontthink Date: Sat, 1 Aug 2009 19:15:13 +0000 (+0000) Subject: Fix broken regular expression X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=a6ec6dff8d3abb429557c8c0b6e30c50885afed3 Fix broken regular expression git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13808 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- 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;