From 24938fe9223c4c337518339e03096f996bb8eedd Mon Sep 17 00:00:00 2001 From: Thalia Date: Fri, 18 Jan 2019 16:22:09 +0000 Subject: [PATCH] Make sure page restrictions are handled as a string Bug: T214173 Change-Id: I3ec9b0a4f797b0e89fd30a9ceafcaaf8a6dce5d9 --- includes/specials/SpecialBlock.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index e47ef0619c..a482720ef3 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -841,7 +841,7 @@ class SpecialBlock extends FormSpecialPage { $restrictions = []; if ( $enablePartialBlocks ) { - if ( !empty( $data['PageRestrictions'] ) ) { + if ( $data['PageRestrictions'] !== '' ) { $restrictions = array_map( function ( $text ) { $title = Title::newFromText( $text ); // Use the link cache since the title has already been loaded when @@ -952,7 +952,7 @@ class SpecialBlock extends FormSpecialPage { $logParams['6::flags'] = self::blockLogFlags( $data, $type ); $logParams['sitewide'] = $block->isSitewide(); - if ( $enablePartialBlocks && !empty( $data['PageRestrictions'] ) ) { + if ( $enablePartialBlocks && $data['PageRestrictions'] !== '' ) { $logParams['7::restrictions'] = [ 'pages' => explode( "\n", $data['PageRestrictions'] ), ]; @@ -1166,7 +1166,7 @@ class SpecialBlock extends FormSpecialPage { // actions other than editing, and there must be no restrictions. if ( isset( $data['Editing'] ) && $data['Editing'] === false ) { $data['EditingRestriction'] = 'partial'; - $data['PageRestrictions'] = []; + $data['PageRestrictions'] = ''; } return self::processForm( $data, $form->getContext() ); } -- 2.20.1