Fixed api.php?action=parse&format=xmlfm hitting PCRE limit.

By the way, regexes weren't needed here at all.

Change-Id: I41d222a4d60ead3655f7565b6703186abcd223e0
This commit is contained in:
Max Semenik 2012-04-02 18:21:26 +04:00 committed by Antoine Musso
parent fbfa5c0087
commit 926afc65c3

View file

@ -260,7 +260,8 @@ See the <a href='https://www.mediawiki.org/wiki/API'>complete documentation</a>,
$text = htmlspecialchars( $text );
// encode all comments or tags as safe blue strings
$text = preg_replace( '/\&lt;(!--.*?--|.*?)\&gt;/', '<span style="color:blue;">&lt;\1&gt;</span>', $text );
$text = str_replace( '&lt;', '<span style="color:blue;">&lt;', $text );
$text = str_replace( '&gt;', '&gt;</span>', $text );
// identify URLs
$protos = wfUrlProtocolsWithoutProtRel();
// This regex hacks around bug 13218 (&quot; included in the URL)