From: Guillaume Blanchard Date: Tue, 17 Aug 2004 15:42:42 +0000 (+0000) Subject: *fix bug in non-breaking space regexp X-Git-Tag: 1.5.0alpha1~2305 X-Git-Url: http://git.cyclocoop.org/%24self?a=commitdiff_plain;h=a3581bcf9cf0f6963988f12c5ad119274d6387f9;p=lhc%2Fweb%2Fwiklou.git *fix bug in non-breaking space regexp *add non-breaking code for French numbers *set MAX_INCLUDE_REPEAT to 100 (I'll remove it when I'll update the per page size max) --- diff --git a/includes/Parser.php b/includes/Parser.php index 3e26d5b2df..205b1bfb71 100644 --- a/includes/Parser.php +++ b/includes/Parser.php @@ -32,7 +32,7 @@ # the generated page would be proportional to the square of the input size. # Hence, we limit the number of inclusions of any given page, thus bringing any # attack back to O(N). -define( "MAX_INCLUDE_REPEAT", 20 ); +define( "MAX_INCLUDE_REPEAT", 100 ); define( "MAX_INCLUDE_SIZE", 1000000 ); // 1 Million # Allowed values for $mOutputType @@ -128,9 +128,10 @@ class Parser $fixtags = array( # french spaces, last one Guillemet-left # only if there is something before the space - '/(.) (\\?|:|;|!|\\302\\273)/i' => '\\1 \\2', + '/ (?=\\?|:|;|!|\\302\\273)/' => ' \\1', + '/(\d) (?=\d{3}\D)/' => '\\1 \\2', # french spaces, Guillemet-right - "/(\\302\\253) /i"=>"\\1 ", + "/(\\302\\253) /"=>"\\1 ", '/
/i' => '
', '/
/i' => '
', '/
/i' => '
', @@ -143,9 +144,10 @@ class Parser } else { $fixtags = array( # french spaces, last one Guillemet-left - '/ (\\?|:|;|!|\\302\\273)/i' => ' \\1', + '/ (?=\\?|:|;|!|\\302\\273)/' => ' \\1', + '/(\d) (?=\d{3}\D)/' => '\\1 \\2', # french spaces, Guillemet-right - '/(\\302\\253) /i' => '\\1 ', + '/(\\302\\253) /' => '\\1 ', '/([^> ]+(0(1|3|9);)[^< ]*)/i' => '\\1', '/
/i' => '
', '/<\\/center *>/i' => '
'