Deprecate calling FileDeleteForm::doDelete without passing a user

Bug: T245682
Change-Id: I33dc25401251f057f3db7d7b69f5ced00a86f896
This commit is contained in:
DannyS712 2020-02-20 02:50:54 +00:00
parent 4e586f5783
commit e8d9ec0d47
2 changed files with 4 additions and 1 deletions

View file

@ -489,6 +489,7 @@ because of Phabricator reports.
- LogEventsList::userCanBitfield
- LogEventsList::userCanViewLogType
- LogPage::addEntry
- FileDeleteForm::doDelete
* Article::insertProtectNullRevision is deprecated. Instead, use
WikiPage::insertProtectNullRevision.
* …

View file

@ -178,7 +178,8 @@ class FileDeleteForm {
* @param ?string &$oldimage Archive name
* @param string $reason Reason of the deletion
* @param bool $suppress Whether to mark all deleted versions as restricted
* @param User|null $user User object performing the request
* @param User|null $user User object performing the request (null defaults to $wgUser
* and is deprecated as of 1.35)
* @param array $tags Tags to apply to the deletion action
* @throws MWException
* @return Status
@ -187,6 +188,7 @@ class FileDeleteForm {
$suppress, User $user = null, $tags = []
) {
if ( $user === null ) {
wfDeprecated( __METHOD__ . ' without passing a $user parameter', '1.35' );
global $wgUser;
$user = $wgUser;
}