From: C. Scott Ananian Date: Thu, 21 Jun 2018 18:53:04 +0000 (-0400) Subject: French space armoring: Use unicode regex instead of octal escapes X-Git-Tag: 1.34.0-rc.0~4962^2 X-Git-Url: http://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=758e671652bad925ac40a88d100ca821aed132a8 French space armoring: Use unicode regex instead of octal escapes Follow up to Id8cdb887182f346acab2d108836ce201626848af Change-Id: I35f7b35746e63a98a115a0dbc9d5869b691c3a9c --- diff --git a/includes/parser/Sanitizer.php b/includes/parser/Sanitizer.php index 89a7c96124..21498f89eb 100644 --- a/includes/parser/Sanitizer.php +++ b/includes/parser/Sanitizer.php @@ -1155,9 +1155,9 @@ class Sanitizer { $fixtags = [ # French spaces, last one Guillemet-left # only if there is something before the space - '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => "\\1$space", + '/(.) (?=[?:;!%»])/u' => "\\1$space", # French spaces, Guillemet-right - '/(\\302\\253) /' => "\\1$space", + '/(«) /u' => "\\1$space", ]; return preg_replace( array_keys( $fixtags ), array_values( $fixtags ), $text ); }