Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/98507


Change subject: (bug 57698) recentchanges displaying raw topic title(?)
......................................................................

(bug 57698) recentchanges displaying raw topic title(?)

As part of an i18n message, topic titles (for which we don't allow wikitext)
were being parsed.
I'm tossing them in as raw parameter now, to make sure they're only replaced
after parsing (and manually apply htmlentities to make sure no unwanted html
shows up)

Bug: 57698
Change-Id: I97983292e04595ec595551185239a9bd625c0eed
---
M FlowActions.php
1 file changed, 9 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/07/98507/1

diff --git a/FlowActions.php b/FlowActions.php
index bd82d51..03aafd6 100644
--- a/FlowActions.php
+++ b/FlowActions.php
@@ -98,13 +98,17 @@
                                        return 
$templating->getUrlGenerator()->generateUrl( $revision->getPostId() );
                                },
                                function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return $templating->getContent( 
$revision, 'wikitext', $user );
+                                       // make sure topic title isn't parsed
+                                       $content = $templating->getContent( 
$revision, 'wikitext', $user );
+                                       return array( 'raw' => 
htmlspecialchars( $content ) );
                                },
                                function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
                                        $previousId = 
$revision->getPrevRevisionId();
                                        if ( $previousId ) {
                                                $previousRevision = 
$block->getStorage()->get( get_class( $revision ), $previousId );
-                                               return $templating->getContent( 
$previousRevision, 'wikitext', $user );
+                                               // make sure topic title isn't 
parsed
+                                               $content = 
$templating->getContent( $previousRevision, 'wikitext', $user );
+                                               return array( 'raw' => 
htmlspecialchars( $content ) );
                                        }
 
                                        return '';
@@ -132,7 +136,9 @@
                                        return 
$templating->getUrlGenerator()->generateUrl( $revision->getPostId() );
                                },
                                function ( PostRevision $revision, Templating 
$templating, User $user, Block $block ) {
-                                       return $templating->getContent( 
$revision, 'wikitext', $user );
+                                       // make sure topic title isn't parsed
+                                       $content = $templating->getContent( 
$revision, 'wikitext', $user );
+                                       return array( 'raw' => 
htmlspecialchars( $content ) );
                                },
                        ),
                        'class' => 'flow-history-new-post',

-- 
To view, visit https://gerrit.wikimedia.org/r/98507
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I97983292e04595ec595551185239a9bd625c0eed
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <mmul...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to