BUG#1860 - Anchors of interwiki links did not get normalized
[lhc/web/wiklou.git] / includes / SpecialUndelete.php
index fc0aa33..e4b34b2 100644 (file)
@@ -217,8 +217,7 @@ class PageArchive {
                        # FIXME: Update latest if newer as well...
                        if( $newid ) {
                                # FIXME: update article count if changed...
-                               $article->updateRevisionOn( $dbw, $revision->getId(), $previousRevId,
-                                       Article::isRedirect( $revision->getText() ) );
+                               $article->updateRevisionOn( $dbw, $revision, $previousRevId );
                                
                                # Finally, clean up the link tables
                                $wgLinkCache = new LinkCache();
@@ -260,7 +259,7 @@ class PageArchive {
                        $reason = wfMsg( 'undeletedrevisions', $restoreRevisions );
                }
                $log->addEntry( 'restore', $this->title, $reason );
-               
+
                return true;
        }
 }
@@ -413,6 +412,10 @@ class UndeleteForm {
                                $userLink = $sk->makeKnownLinkObj(
                                        Title::makeTitle( NS_USER, $row->ar_user_text ),
                                        $userLink );
+                       } else {
+                               $userLink = $sk->makeKnownLinkObj(
+                                       Title::makeTitle( NS_SPECIAL, 'Contributions' ),
+                                       $userLink, 'target=' . $row->ar_user_text );
                        }
                        $comment = $sk->commentBlock( $row->ar_comment );
                        $wgOut->addHTML( "<li>$checkBox $pageLink . . $userLink $comment</li>\n" );
@@ -430,6 +433,12 @@ class UndeleteForm {
                        $archive = new PageArchive( $this->mTargetObj );
                        if( $archive->undelete( $this->mTargetTimestamp ) ) {
                                $wgOut->addWikiText( wfMsg( "undeletedtext", $this->mTarget ) );
+
+                               if (NS_IMAGE == $this->mTargetObj->getNamespace()) {
+                                       /* refresh image metadata cache */
+                                       new Image( $this->mTargetObj->getText(), true );
+                               }
+
                                return true;
                        }
                }