From 926afc65c316c6e7cf3935c740c9328ceb57c84a Mon Sep 17 00:00:00 2001 From: Max Semenik Date: Mon, 2 Apr 2012 18:21:26 +0400 Subject: [PATCH] Fixed api.php?action=parse&format=xmlfm hitting PCRE limit. By the way, regexes weren't needed here at all. Change-Id: I41d222a4d60ead3655f7565b6703186abcd223e0 --- includes/api/ApiFormatBase.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) -- 2.20.1