Merge "Use stashed ParserOutput during saving."
[lhc/web/wiklou.git] / includes / Storage / DerivedPageDataUpdater.php
index 4556af0..d837a53 100644 (file)
@@ -351,13 +351,9 @@ class DerivedPageDataUpdater implements IDBAccessObject {
                        throw new InvalidArgumentException( '$parentId should match the parent of $revision' );
                }
 
-               if ( $revision
-                       && $user
-                       && $revision->getUser( RevisionRecord::RAW )->getName() !== $user->getName()
-               ) {
-                       throw new InvalidArgumentException( '$user should match the author of $revision' );
-               }
-
+               // NOTE: For null revisions, $user may be different from $this->revision->getUser
+               // and also from $revision->getUser.
+               // But $user should always match $this->user.
                if ( $user && $this->user && $user->getName() !== $this->user->getName() ) {
                        return false;
                }
@@ -368,10 +364,6 @@ class DerivedPageDataUpdater implements IDBAccessObject {
                        return false;
                }
 
-               if ( $revision && !$user ) {
-                       $user = $revision->getUser( RevisionRecord::RAW );
-               }
-
                if ( $this->pageState
                        && $revision
                        && $revision->getParentId() !== null
@@ -387,22 +379,6 @@ class DerivedPageDataUpdater implements IDBAccessObject {
                        return false;
                }
 
-               if ( $this->revision
-                       && $user
-                       && $this->revision->getUser( RevisionRecord::RAW )
-                       && $this->revision->getUser( RevisionRecord::RAW )->getName() !== $user->getName()
-               ) {
-                       return false;
-               }
-
-               if ( $revision
-                       && $this->user
-                       && $this->revision->getUser( RevisionRecord::RAW )
-                       && $revision->getUser( RevisionRecord::RAW )->getName() !== $this->user->getName()
-               ) {
-                       return false;
-               }
-
                // NOTE: this check is the primary reason for having the $this->slotsUpdate field!
                if ( $this->slotsUpdate
                        && $slotsUpdate