X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fapi%2FApiDelete.php;h=a63dee6fc186309b62a2ed0b14d5e03bcc52f01d;hp=7766acd3636966ce703b3ef639ae93ca89d37e09;hb=a15339a9b55338e72bccf033103e423eedb4c208;hpb=d19826aa35b206847a568a4b2c1c9ffaa615fca5 diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index 7766acd363..a63dee6fc1 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -1,9 +1,5 @@ .@gmail.com" * * This program is free software; you can redistribute it and/or modify @@ -59,7 +55,7 @@ class ApiDelete extends ApiBase { // If change tagging was requested, check that the user is allowed to tag, // and the tags are valid - if ( count( $params['tags'] ) ) { + if ( $params['tags'] ) { $tagStatus = ChangeTags::canAddTagsAccompanyingChange( $params['tags'], $user ); if ( !$tagStatus->isOK() ) { $this->dieStatus( $tagStatus ); @@ -120,7 +116,8 @@ class ApiDelete extends ApiBase { $hasHistory = false; $reason = $page->getAutoDeleteReason( $hasHistory ); if ( $reason === false ) { - return Status::newFatal( 'cannotdelete', $title->getPrefixedText() ); + // Should be reachable only if the page has no revisions + return Status::newFatal( 'cannotdelete', $title->getPrefixedText() ); // @codeCoverageIgnore } }