$suggestedDurations = self::getSuggestedDurations();
$conf = $this->getConfig();
- $oldCommentSchema = $conf->get( 'CommentTableSchemaMigrationStage' ) === MIGRATION_OLD;
$enablePartialBlocks = $conf->get( 'EnablePartialBlocks' );
$a = [];
'type' => 'selectandother',
// HTML maxlength uses "UTF-16 code units", which means that characters outside BMP
// (e.g. emojis) count for two each. This limit is overridden in JS to instead count
- // Unicode codepoints (or 255 UTF-8 bytes for old schema).
- 'maxlength' => $oldCommentSchema ? 255 : CommentStore::COMMENT_CHARACTER_LIMIT,
+ // Unicode codepoints.
+ 'maxlength' => CommentStore::COMMENT_CHARACTER_LIMIT,
'maxlength-unit' => 'codepoints',
'options-message' => 'ipbreason-dropdown',
'section' => 'reason',
$performer = $context->getUser();
$enablePartialBlocks = $context->getConfig()->get( 'EnablePartialBlocks' );
+ $isPartialBlock = $enablePartialBlocks &&
+ isset( $data['EditingRestriction'] ) &&
+ $data['EditingRestriction'] === 'partial';
// Handled by field validator callback
// self::validateTargetField( $data['Target'] );
return [ 'badaccess-group0' ];
}
+ if ( $isPartialBlock ) {
+ return [ 'ipb_hide_partial' ];
+ }
+
# Recheck params here...
if ( $type != Block::TYPE_USER ) {
$data['HideUser'] = false; # IP users should not be hidden
$block->isAutoblocking( $data['AutoBlock'] );
$block->mHideName = $data['HideUser'];
- if (
- $enablePartialBlocks &&
- isset( $data['EditingRestriction'] ) &&
- $data['EditingRestriction'] === 'partial'
- ) {
- $block->isSitewide( false );
+ if ( $isPartialBlock ) {
+ $block->isSitewide( false );
}
$reason = [ 'hookaborted' ];
$title = Title::newFromText( $text );
// Use the link cache since the title has already been loaded when
// the field was validated.
- $restriction = new PageRestriction( 0, $title->getArticleId() );
+ $restriction = new PageRestriction( 0, $title->getArticleID() );
$restriction->setTitle( $title );
return $restriction;
}, explode( "\n", $data['PageRestrictions'] ) );