From 8cde3600cf32ec7ab67b0b0048f901e114f99599 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 13 Sep 2007 19:06:54 +0000 Subject: [PATCH] Reverting r25082: Do not restore security vulnerabilities to the codebase after a security release. Especially don't MAKE THEM WORSE IN THE PROCESS. --- includes/api/ApiFormatBase.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/api/ApiFormatBase.php b/includes/api/ApiFormatBase.php index dec6cd37d5..b69ebafe09 100644 --- a/includes/api/ApiFormatBase.php +++ b/includes/api/ApiFormatBase.php @@ -158,6 +158,8 @@ See complete documentation, or * This method also replaces any '<' with < */ protected function formatHTML($text) { + // Escape everything first for full coverage + $text = htmlspecialchars($text); // encode all comments or tags as safe blue strings $text = preg_replace('/\<(!--.*?--|.*?)\>/', '<\1>', $text); -- 2.20.1