X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=includes%2Fblock%2FDatabaseBlock.php;h=b1a8e215b8dac6f7b101ec117fc1aa6f892e0836;hb=e9c6bf46518a09b8fef1f3d0035a9e2e9489a119;hp=79286c5acf7aac87bd84d38ea4f5f00b681c5d1b;hpb=41355718e137b2ed88160ad5ddb4db50336d54d9;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/block/DatabaseBlock.php b/includes/block/DatabaseBlock.php index 79286c5acf..b1a8e215b8 100644 --- a/includes/block/DatabaseBlock.php +++ b/includes/block/DatabaseBlock.php @@ -24,7 +24,6 @@ namespace MediaWiki\Block; use ActorMigration; use AutoCommitUpdate; -use BadMethodCallException; use CommentStore; use DeferredUpdates; use Hooks; @@ -86,18 +85,18 @@ class DatabaseBlock extends AbstractBlock { /** * Create a new block with specified option parameters on a user, IP or IP range. * - * @param array $options Parameters of the block: - * user int Override target user ID (for foreign users) - * auto bool Is this an automatic block? - * expiry string Timestamp of expiration of the block or 'infinity' - * anonOnly bool Only disallow anonymous actions - * createAccount bool Disallow creation of new accounts - * enableAutoblock bool Enable automatic blocking - * blockEmail bool Disallow sending emails - * allowUsertalk bool Allow the target to edit its own talk page - * sitewide bool Disallow editing all pages and all contribution - * actions, except those specifically allowed by - * other block flags + * @param array $options Parameters of the block, with options supported by + * `AbstractBlock::__construct`, and also: + * - user: (int) Override target user ID (for foreign users) + * - auto: (bool) Is this an automatic block? + * - expiry: (string) Timestamp of expiration of the block or 'infinity' + * - anonOnly: (bool) Only disallow anonymous actions + * - createAccount: (bool) Disallow creation of new accounts + * - enableAutoblock: (bool) Enable automatic blocking + * - blockEmail: (bool) Disallow sending emails + * - allowUsertalk: (bool) Allow the target to edit its own talk page + * - sitewide: (bool) Disallow editing all pages and all contribution actions, + * except those specifically allowed by other block flags * * @since 1.26 $options array */ @@ -161,47 +160,6 @@ class DatabaseBlock extends AbstractBlock { } } - /** - * Return the list of ipblocks fields that should be selected to create - * a new block. - * @deprecated since 1.31, use self::getQueryInfo() instead. - * @return array - */ - public static function selectFields() { - global $wgActorTableSchemaMigrationStage; - - if ( $wgActorTableSchemaMigrationStage & SCHEMA_COMPAT_READ_NEW ) { - // If code is using this instead of self::getQueryInfo(), there's a - // decent chance it's going to try to directly access - // $row->ipb_by or $row->ipb_by_text and we can't give it - // useful values here once those aren't being used anymore. - throw new BadMethodCallException( - 'Cannot use ' . __METHOD__ - . ' when $wgActorTableSchemaMigrationStage has SCHEMA_COMPAT_READ_NEW' - ); - } - - wfDeprecated( __METHOD__, '1.31' ); - return [ - 'ipb_id', - 'ipb_address', - 'ipb_by', - 'ipb_by_text', - 'ipb_by_actor' => 'NULL', - 'ipb_timestamp', - 'ipb_auto', - 'ipb_anon_only', - 'ipb_create_account', - 'ipb_enable_autoblock', - 'ipb_expiry', - 'ipb_deleted', - 'ipb_block_email', - 'ipb_allow_usertalk', - 'ipb_parent_block_id', - 'ipb_sitewide', - ] + CommentStore::getStore()->getFields( 'ipb_reason' ); - } - /** * Return the tables, fields, and join conditions to be selected to create * a new block object.