https://bugzilla.wikimedia.org/show_bug.cgi?id=17119

           Summary: class Parser: senseless use of non-existing regexp back
                    reference
           Product: MediaWiki
           Version: unspecified
          Platform: All
               URL: http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/i
                    ncludes/parser/Parser.php?view=markup
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: Normal
         Component: General/Unknown
        AssignedTo: [email protected]
        ReportedBy: [email protected]


There's a small error in line
  '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1 \\2',
in file 
 
http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/includes/parser/Parser.php?view=markup

$2 (or \2 respectively) is not defined here, because zero-width look-ahead
assertions (?=...) are non-capturing patterns.

I suggest one of the following solutions

  '/(.) (\\?|:|;|!|%|\\302\\273)/' => '\\1 \\2',
  '/(.) (?=\\?|:|;|!|%|\\302\\273)/' => '\\1 ',
  '/(?<=.) (?=\\?|:|;|!|%|\\302\\273)/' => ' ',

I don't know which of those is the best. I guess the first one is the slowest.

Btw. for uniformity you could modify the lines
  '/(\\302\\253) /' => '\\1&nbsp;',
  '/&nbsp;(!\s*important)/' => ' \\1', #Beware of CSS magic word !important,
bug #11874.
analogously.


-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to