Use ParserOutput stateless transforms
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index 39904b0..0c038c1 100644 (file)
@@ -235,7 +235,7 @@ class SpecialUndelete extends SpecialPage {
        function showSearchForm() {
                $out = $this->getOutput();
                $out->setPageTitle( $this->msg( 'undelete-search-title' ) );
-               $fuzzySearch = $this->getRequest()->getVal( 'fuzzy', false );
+               $fuzzySearch = $this->getRequest()->getVal( 'fuzzy', true );
 
                $out->enableOOUI();
 
@@ -277,7 +277,7 @@ class SpecialUndelete extends SpecialPage {
                        $fieldset,
                        new OOUI\HtmlSnippet(
                                Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
-                               Html::hidden( 'fuzzy', $this->getRequest()->getVal( 'fuzzy' ) )
+                               Html::hidden( 'fuzzy', $fuzzySearch )
                        )
                );
 
@@ -455,7 +455,9 @@ class SpecialUndelete extends SpecialPage {
                        $popts->setEditSection( false );
 
                        $pout = $content->getParserOutput( $this->mTargetObj, $rev->getId(), $popts, true );
-                       $out->addParserOutput( $pout );
+                       $out->addParserOutput( $pout, [
+                               'enableSectionEditLinks' => false,
+                       ] );
                }
 
                if ( $isText ) {
@@ -669,13 +671,7 @@ class SpecialUndelete extends SpecialPage {
 
                $archive = new PageArchive( $this->mTargetObj, $this->getConfig() );
                Hooks::run( 'UndeleteForm::showHistory', [ &$archive, $this->mTargetObj ] );
-               /*
-               $text = $archive->getLastRevisionText();
-               if( is_null( $text ) ) {
-                       $out->addWikiMsg( 'nohistory' );
-                       return;
-               }
-               */
+
                $out->addHTML( '<div class="mw-undelete-history">' );
                if ( $this->mAllowed ) {
                        $out->addWikiMsg( 'undeletehistory' );
@@ -975,12 +971,12 @@ class SpecialUndelete extends SpecialPage {
                        $key = urlencode( $row->fa_storage_key );
                        $pageLink = $this->getFileLink( $file, $this->getPageTitle(), $ts, $key );
                } else {
-                       $pageLink = $this->getLanguage()->userTimeAndDate( $ts, $user );
+                       $pageLink = htmlspecialchars( $this->getLanguage()->userTimeAndDate( $ts, $user ) );
                }
                $userLink = $this->getFileUser( $file );
                $data = $this->msg( 'widthheight' )->numParams( $row->fa_width, $row->fa_height )->text();
                $bytes = $this->msg( 'parentheses' )
-                       ->rawParams( $this->msg( 'nbytes' )->numParams( $row->fa_size )->text() )
+                       ->plaintextParams( $this->msg( 'nbytes' )->numParams( $row->fa_size )->text() )
                        ->plain();
                $data = htmlspecialchars( $data . ' ' . $bytes );
                $comment = $this->getFileComment( $file );
@@ -1055,7 +1051,7 @@ class SpecialUndelete extends SpecialPage {
                $time = $this->getLanguage()->userTimeAndDate( $ts, $user );
 
                if ( !$file->userCan( File::DELETED_FILE, $user ) ) {
-                       return '<span class="history-deleted">' . $time . '</span>';
+                       return '<span class="history-deleted">' . htmlspecialchars( $time ) . '</span>';
                }
 
                $link = $this->getLinkRenderer()->makeKnownLink(