X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fapi%2FApiDelete.php;h=ec857b7da968ec694e095640d1d1e386e0054a27;hb=e377892d422bd75301131158f3ff2258c4020885;hp=e19f1f221681997728f73019f90a2ddfde45d49f;hpb=b610a3b617f7616b2f1db12498cbad5aeae12576;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/api/ApiDelete.php b/includes/api/ApiDelete.php index e19f1f2216..ec857b7da9 100644 --- a/includes/api/ApiDelete.php +++ b/includes/api/ApiDelete.php @@ -116,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 } } @@ -138,7 +139,7 @@ class ApiDelete extends ApiBase { * @param Page $page Object to work on * @param User $user User doing the action * @param string $oldimage Archive name - * @param string &$reason Reason for the deletion. Autogenerated if null. + * @param string|null &$reason Reason for the deletion. Autogenerated if null. * @param bool $suppress Whether to mark all deleted versions as restricted * @param array $tags Tags to tag the deletion with * @return Status