Pass user and user_text to Revision constructor
authorumherirrender <umherirrender_de.wp@web.de>
Mon, 28 Apr 2014 17:09:28 +0000 (19:09 +0200)
committerUmherirrender <umherirrender_de.wp@web.de>
Mon, 28 Apr 2014 17:20:30 +0000 (17:20 +0000)
This avoids the use of $wgUser in Revision constructor and makes the
dependency on the global visible.

Change-Id: Ief79c9769d28a1adb16abab8da1ec01984d9ef92

includes/Title.php
includes/WikiPage.php

index eec4dd6..70d2baa 100644 (file)
@@ -3906,6 +3906,8 @@ class Title {
                                $redirectRevision = new Revision( array(
                                        'title' => $this, // for determining the default content model
                                        'page' => $newid,
+                                       'user_text' => $wgUser->getName(),
+                                       'user' => $wgUser->getId(),
                                        'comment' => $comment,
                                        'content' => $redirectContent ) );
                                $redirectRevision->insertOn( $dbw );
index 161125d..128fd82 100644 (file)
@@ -2274,6 +2274,8 @@ class WikiPage implements Page, IDBAccessObject {
                $revision = new Revision( array(
                        'title'      => $this->getTitle(), // for determining the default content model
                        'page'       => $this->getId(),
+                       'user_text'  => $user->getName(),
+                       'user'       => $user->getId(),
                        'text'       => $serialized,
                        'length'     => $content->getSize(),
                        'comment'    => $comment,