Merge branch 'master' into Wikidata
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index 06b578d..47e88d0 100644 (file)
@@ -116,7 +116,8 @@ class PageArchive {
                $res = $dbr->select( 'archive',
                        array(
                                'ar_minor_edit', 'ar_timestamp', 'ar_user', 'ar_user_text',
-                               'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id', 'ar_sha1'
+                               'ar_comment', 'ar_len', 'ar_deleted', 'ar_rev_id', 'ar_sha1',
+                'ar_content_format', 'ar_content_model'
                        ),
                        array( 'ar_namespace' => $this->title->getNamespace(),
                                   'ar_title' => $this->title->getDBkey() ),
@@ -189,6 +190,8 @@ class PageArchive {
                                'ar_deleted',
                                'ar_len',
                                'ar_sha1',
+                'ar_content_format',
+                'ar_content_model',
                        ),
                        array( 'ar_namespace' => $this->title->getNamespace(),
                                        'ar_title' => $this->title->getDBkey(),
@@ -462,7 +465,9 @@ class PageArchive {
                                'ar_deleted',
                                'ar_page_id',
                                'ar_len',
-                               'ar_sha1' ),
+                               'ar_sha1',
+                'ar_content_format',
+                'ar_content_model' ),
                        /* WHERE */ array(
                                'ar_namespace' => $this->title->getNamespace(),
                                'ar_title'     => $this->title->getDBkey(),
@@ -892,7 +897,8 @@ class SpecialUndelete extends SpecialPage {
         * @return String: HTML
         */
        function showDiff( $previousRev, $currentRev ) {
-               $diffEngine = new DifferenceEngine( $this->getContext() );
+        $contentHandler = ContentHandler::getForTitle( $this->getTitle() );
+               $diffEngine = $contentHandler->getDifferenceEngine( $this->getContext() );
                $diffEngine->showDiffStyle();
                $this->getOutput()->addHTML(
                        "<div>" .
@@ -909,8 +915,8 @@ class SpecialUndelete extends SpecialPage {
                                $this->diffHeader( $currentRev, 'n' ) .
                                "</td>\n" .
                        "</tr>" .
-                       $diffEngine->generateDiffBody(
-                               $previousRev->getText(), $currentRev->getText() ) .
+                       $diffEngine->generateContentDiffBody(
+                               $previousRev->getContent(), $currentRev->getContent() ) .
                        "</table>" .
                        "</div>\n"
                );