Page MenuHomePhorge

No OneTemporary

Size
5 KB
Referenced Files
None
Subscribers
None
diff --git a/RELEASE-NOTES-1.44 b/RELEASE-NOTES-1.44
index 11485fdac5e..ec6473f1e78 100644
--- a/RELEASE-NOTES-1.44
+++ b/RELEASE-NOTES-1.44
@@ -664,11 +664,6 @@ because of Phabricator reports.
- Xml::check() – use Html::check() instead
* BlockUtils and BlockUtilsFactory is now deprecated. Use BlockTargetFactory
and CrossWikiBlockTargetFactory.
-* Passing a string or UserIdentity object to DatabaseBlock::setTarget() or
- the 'address' parameter to DatabaseBlock::__construct() is now deprecated
- and will emit deprecation warnings. Use BlockTargetFactory to obtain a
- BlockTarget to pass to the 'target' parameter of these functions, or use
- DatabaseBlockStore::newUnsaved() or ::insertBlockWithParams(). (T385966)
* RenameuserSQL::rename has been deprecated and should be replaced with
RenameuserSQL::renameUser, which returns a Status instead of boolean.
* LocalFile::getQueryInfo() and OldLocalFile::getQueryInfo(), deprecated
diff --git a/includes/block/AbstractBlock.php b/includes/block/AbstractBlock.php
index 8e7de5fede0..667a5bd586c 100644
--- a/includes/block/AbstractBlock.php
+++ b/includes/block/AbstractBlock.php
@@ -76,7 +76,8 @@ abstract class AbstractBlock implements Block {
*
* @param array $options Parameters of the block, with supported options:
* - target: (BlockTarget) The target object (since 1.44)
- * - address: (string|UserIdentity) Deprecated since 1.44, use 'target'.
+ * - address: (string|UserIdentity) Target user name, user identity object,
+ * IP address or IP range.
* - wiki: (string|false) The wiki the block has been issued in,
* self::LOCAL for the local wiki (since 1.38)
* - reason: (string|Message|CommentStoreComment) Reason for the block
@@ -106,9 +107,6 @@ abstract class AbstractBlock implements Block {
}
$this->setTarget( $options['target'] );
} elseif ( isset( $options['address'] ) ) {
- wfDeprecatedMsg(
- 'The address parameter to AbstractBlock::__construct is deprecated since 1.44',
- '1.44' );
$this->setTarget( $options['address'] );
} else {
$this->setTarget( null );
@@ -409,8 +407,7 @@ abstract class AbstractBlock implements Block {
/**
* Set the target for this block
- * @param BlockTarget|string|UserIdentity|null $target Passing UserIdentity|string is deprecated
- * since 1.44. Set the target by passing BlockTarget|null.
+ * @param BlockTarget|string|UserIdentity|null $target
*/
public function setTarget( $target ) {
// Small optimization to make this code testable, this is what would happen anyway
@@ -420,10 +417,6 @@ abstract class AbstractBlock implements Block {
$this->assertWiki( $target->getWikiId() );
$this->target = $target;
} else {
- wfDeprecatedMsg(
- 'Passing UserIdentity|string to AbstractBlock::setTarget is deprecated since 1.44',
- '1.44'
- );
$parsedTarget = MediaWikiServices::getInstance()
->getCrossWikiBlockTargetFactory()
->getFactory( $this->wikiId )
diff --git a/includes/block/BlockManager.php b/includes/block/BlockManager.php
index 8a400c49013..817374a46e8 100644
--- a/includes/block/BlockManager.php
+++ b/includes/block/BlockManager.php
@@ -361,8 +361,7 @@ class BlockManager {
return $blocks[ 0 ];
} else {
$compositeBlock = CompositeBlock::createFromBlocks( ...$blocks );
- $target = $ip === null ? null : $this->blockTargetFactory->newAnonIpBlockTarget( $ip );
- $compositeBlock->setTarget( $target );
+ $compositeBlock->setTarget( $ip );
return $compositeBlock;
}
}
diff --git a/tests/phpunit/includes/block/DatabaseBlockTest.php b/tests/phpunit/includes/block/DatabaseBlockTest.php
index e1a1b8af150..f56ce8eb4bf 100644
--- a/tests/phpunit/includes/block/DatabaseBlockTest.php
+++ b/tests/phpunit/includes/block/DatabaseBlockTest.php
@@ -272,8 +272,7 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
'sitewide' => true,
] );
- $block->setTarget(
- new UserBlockTarget( new UserIdentityValue( $user->getId(), $user->getName() ) ) );
+ $block->setTarget( new UserIdentityValue( $user->getId(), $user->getName() ) );
$block->setBlocker( $this->getTestSysop()->getUser() );
$blockStore = $this->getServiceContainer()->getDatabaseBlockStore();
@@ -300,7 +299,7 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
'sitewide' => false,
] );
- $block->setTarget( new UserBlockTarget( $user ) );
+ $block->setTarget( $user );
$block->setBlocker( $this->getTestSysop()->getUser() );
$blockStore = $this->getServiceContainer()->getDatabaseBlockStore();
@@ -332,7 +331,7 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
'sitewide' => true,
] );
- $block->setTarget( new UserBlockTarget( $user ) );
+ $block->setTarget( $user );
$block->setBlocker( $this->getTestSysop()->getUser() );
$blockStore = $this->getServiceContainer()->getDatabaseBlockStore();
@@ -357,7 +356,7 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
'sitewide' => false,
] );
- $block->setTarget( new UserBlockTarget( $user ) );
+ $block->setTarget( $user );
$block->setBlocker( $this->getTestSysop()->getUser() );
$blockStore = $this->getServiceContainer()->getDatabaseBlockStore();
@@ -386,7 +385,7 @@ class DatabaseBlockTest extends MediaWikiLangTestCase {
'sitewide' => false,
] );
- $block->setTarget( new UserBlockTarget( $user ) );
+ $block->setTarget( $user );
$block->setBlocker( $this->getTestSysop()->getUser() );
$blockStore = $this->getServiceContainer()->getDatabaseBlockStore();

File Metadata

Mime Type
text/x-diff
Expires
Sat, Jul 5, 5:32 AM (17 h, 27 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
227562
Default Alt Text
(5 KB)

Event Timeline