Escape unescaped messages shown on a diff page
[lhc/web/wiklou.git] / includes / diff / DifferenceEngine.php
index dd5f3c7..a458831 100644 (file)
@@ -283,7 +283,7 @@ class DifferenceEngine extends ContextSource {
                        $samePage = true;
                        $oldHeader = '';
                } else {
-                       wfRunHooks( 'DiffViewHeader', array( $this, $this->mOldRev, $this->mNewRev ) );
+                       Hooks::run( 'DiffViewHeader', array( $this, $this->mOldRev, $this->mNewRev ) );
 
                        if ( $this->mNewPage->equals( $this->mOldPage ) ) {
                                $out->setPageTitle( $this->msg( 'difference-title', $this->mNewPage->getPrefixedText() ) );
@@ -387,7 +387,7 @@ class DifferenceEngine extends ContextSource {
                $rdel = $this->revisionDeleteLink( $this->mNewRev );
 
                # Allow extensions to define their own revision tools
-               wfRunHooks( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) );
+               Hooks::run( 'DiffRevisionTools', array( $this->mNewRev, &$revisionTools, $this->mOldRev ) );
                $formattedRevisionTools = array();
                // Put each one in parentheses (poor man's button)
                foreach ( $revisionTools as $key => $tool ) {
@@ -555,7 +555,7 @@ class DifferenceEngine extends ContextSource {
                <h2 class='diff-currentversion-title'>{$revHeader}</h2>\n" );
                # Page content may be handled by a hooked call instead...
                # @codingStandardsIgnoreStart Ignoring long lines.
-               if ( wfRunHooks( 'ArticleContentOnDiff', array( $this, $out ) ) ) {
+               if ( Hooks::run( 'ArticleContentOnDiff', array( $this, $out ) ) ) {
                        $this->loadNewText();
                        $out->setRevisionId( $this->mNewid );
                        $out->setRevisionTimestamp( $this->mNewRev->getTimestamp() );
@@ -575,7 +575,7 @@ class DifferenceEngine extends ContextSource {
                                                $out->addParserOutputContent( $po );
                                        }
                                }
-                       } elseif ( !wfRunHooks( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+                       } elseif ( !Hooks::run( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
                                // Handled by extension
                        } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
                                // NOTE: deprecated hook, B/C only
@@ -742,7 +742,7 @@ class DifferenceEngine extends ContextSource {
                $difftext = $this->generateContentDiffBody( $this->mOldContent, $this->mNewContent );
 
                // Save to cache for 7 days
-               if ( !wfRunHooks( 'AbortDiffCache', array( &$this ) ) ) {
+               if ( !Hooks::run( 'AbortDiffCache', array( &$this ) ) ) {
                        wfIncrStats( 'diff_uncacheable' );
                } elseif ( $key !== false && $difftext !== false ) {
                        wfIncrStats( 'diff_cache_miss' );
@@ -1062,7 +1062,7 @@ class DifferenceEngine extends ContextSource {
                        $key = $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold';
                        $msg = $this->msg( $key )->escaped();
                        $editLink = $this->msg( 'parentheses' )->rawParams(
-                               Linker::linkKnown( $title, $msg, array( ), $editQuery ) )->plain();
+                               Linker::linkKnown( $title, $msg, array( ), $editQuery ) )->escaped();
                        $header .= ' ' . Html::rawElement(
                                'span',
                                array( 'class' => 'mw-diff-edit' ),
@@ -1224,7 +1224,7 @@ class DifferenceEngine extends ContextSource {
                        $this->mNewid = 0;
                }
 
-               wfRunHooks(
+               Hooks::run(
                        'NewDifferenceEngine',
                        array( $this->getTitle(), &$this->mOldid, &$this->mNewid, $old, $new )
                );