From 2e2141866b10b4681d260f1f03c840d86c8c39c3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 6 Jul 2008 20:19:04 +0000 Subject: [PATCH] * (bug 14646) Fix some double-escaping of HTML in feed output Log entry action text was being double-escaped by running HTML through the comment parser. Log action text is now output as straight HTML. The link for long diffs was also coming out wrong on English Wikipedia due to overloading of messages. Switched from 'differenes' (which is a label text which had gotten turned into an HTML link there) to 'showdiff', which is a plaintext button label. (Might consider making it a separate message which is a little more descriptive.) --- RELEASE-NOTES | 2 ++ includes/FeedUtils.php | 11 ++++++----- includes/LogPage.php | 1 + 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index c5d7544ee6..6758804bc4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -413,6 +413,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 14088) Excessively long block expiry times are rejected as invalid, keeps the log page from being distorted. * (bug 14708) Emulate INSERT...IGNORE with standard SQL for Postgres backend. +* (bug 14646) Fix some double-escaping of HTML in feed output + === API changes in 1.13 === diff --git a/includes/FeedUtils.php b/includes/FeedUtils.php index 4412a14bcf..aa784c026d 100644 --- a/includes/FeedUtils.php +++ b/includes/FeedUtils.php @@ -59,10 +59,11 @@ class FeedUtils { $skin = $wgUser->getSkin(); # log enties - if( $actiontext ) { - $comment = "$actiontext $comment"; - } - $completeText = '

' . $skin->formatComment( $comment ) . "

\n"; + $completeText = '

' . implode( ' ', + array_filter( + array( + $actiontext, + $skin->formatComment( $comment ) ) ) ) . "

\n"; //NOTE: Check permissions for anonymous users, not current user. // No "privileged" version should end up in the cache. @@ -92,7 +93,7 @@ class FeedUtils { $diffText = '' . - htmlspecialchars( wfMsgForContent( 'difference' ) ) . + htmlspecialchars( wfMsgForContent( 'showdiff' ) ) . ''; } elseif ( $diffText === false ) { // Error in diff engine, probably a missing revision diff --git a/includes/LogPage.php b/includes/LogPage.php index fcc245a62e..58e486f7de 100644 --- a/includes/LogPage.php +++ b/includes/LogPage.php @@ -143,6 +143,7 @@ class LogPage { /** * @static + * @return HTML string */ static function actionText( $type, $action, $title = NULL, $skin = NULL, $params = array(), $filterWikilinks=false ) { global $wgLang, $wgContLang, $wgLogActions; -- 2.20.1