X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=blobdiff_plain;f=includes%2Fapi%2FApiDelete.php;h=a63dee6fc186309b62a2ed0b14d5e03bcc52f01d;hb=a3a7176b6539f97d4f723aaacc20f0c18a48bc1d;hp=7766acd3636966ce703b3ef639ae93ca89d37e09;hpb=3df3b575c6617df64ec98533cc7141bd2314e274;p=lhc%2Fweb%2Fwiklou.git 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 } }