Merge "Try to avoid master queries for GET requests"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 17 Jan 2019 18:46:14 +0000 (18:46 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 17 Jan 2019 18:46:14 +0000 (18:46 +0000)
includes/skins/Skin.php

index e31bc06..7a2679e 100644 (file)
@@ -716,10 +716,12 @@ abstract class Skin extends ContextSource {
         */
        function getUndeleteLink() {
                $action = $this->getRequest()->getVal( 'action', 'view' );
+               $title = $this->getTitle();
 
-               if ( $this->getTitle()->userCan( 'deletedhistory', $this->getUser() ) &&
-                       ( !$this->getTitle()->exists() || $action == 'history' ) ) {
-                       $n = $this->getTitle()->isDeleted();
+               if ( ( !$title->exists() || $action == 'history' ) &&
+                       $title->userCan( 'deletedhistory', $this->getUser() )
+               ) {
+                       $n = $title->isDeleted();
 
                        if ( $n ) {
                                if ( $this->getTitle()->quickUserCan( 'undelete', $this->getUser() ) ) {