From: Max Semenik Date: Mon, 2 Apr 2012 14:21:26 +0000 (+0400) Subject: Fixed api.php?action=parse&format=xmlfm hitting PCRE limit. X-Git-Tag: 1.31.0-rc.0~24064 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=926afc65c316c6e7cf3935c740c9328ceb57c84a;p=lhc%2Fweb%2Fwiklou.git Fixed api.php?action=parse&format=xmlfm hitting PCRE limit. By the way, regexes weren't needed here at all. Change-Id: I41d222a4d60ead3655f7565b6703186abcd223e0 --- diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index 57c641df56..17e9225c16 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -260,7 +260,8 @@ See the complete documentation, $text = htmlspecialchars( $text ); // encode all comments or tags as safe blue strings - $text = preg_replace( '/\<(!--.*?--|.*?)\>/', '<\1>', $text ); + $text = str_replace( '<', '<', $text ); + $text = str_replace( '>', '>', $text ); // identify URLs $protos = wfUrlProtocolsWithoutProtRel(); // This regex hacks around bug 13218 (" included in the URL)