Merge "Maintenance: Add an easy way to access Config instances"
[lhc/web/wiklou.git] / includes / Title.php
index bcf9cbd..ca292ee 100644 (file)
@@ -2265,7 +2265,7 @@ class Title {
                } elseif ( $action == 'delete' ) {
                        $tempErrors = $this->checkPageRestrictions( 'edit',
                                $user, array(), $doExpensiveQueries, true );
-                       if( !$tempErrors ) {
+                       if ( !$tempErrors ) {
                                $tempErrors = $this->checkCascadingSourcesRestrictions( 'edit',
                                        $user, $tempErrors, $doExpensiveQueries, true );
                        }
@@ -3931,9 +3931,13 @@ class Title {
                        $redirectContent = null;
                }
 
+               // bug 57084: log_page should be the ID of the *moved* page
+               $oldid = $this->getArticleID();
+               $logTitle = clone $this;
+
                $logEntry = new ManualLogEntry( 'move', $logType );
                $logEntry->setPerformer( $wgUser );
-               $logEntry->setTarget( $this );
+               $logEntry->setTarget( $logTitle );
                $logEntry->setComment( $reason );
                $logEntry->setParameters( array(
                        '4::target' => $nt->getPrefixedText(),
@@ -3949,8 +3953,6 @@ class Title {
                # Truncate for whole multibyte characters.
                $comment = $wgContLang->truncate( $comment, 255 );
 
-               $oldid = $this->getArticleID();
-
                $dbw = wfGetDB( DB_MASTER );
 
                $newpage = WikiPage::factory( $nt );