Fix tags not being set in Special:Block
authorJustin Du <justin.d128@gmail.com>
Fri, 27 Jan 2017 15:31:47 +0000 (09:31 -0600)
committerMtDu <justin.d128@gmail.com>
Sun, 29 Jan 2017 18:22:18 +0000 (18:22 +0000)
Currently, a PHP error is thrown when tags are not set
in Special:Block on line 832. This patch fixes this
by adding an extra isset() check to see if the tags
variable is set.

Bug: T156486
Change-Id: Ib8722bffbcac5953263ded41eceb3d389d0932f0

includes/specials/SpecialBlock.php

index 93cb377..c18ae0e 100644 (file)
@@ -829,7 +829,7 @@ class SpecialBlock extends FormSpecialPage {
                $logEntry->setRelations( [ 'ipb_id' => $blockIds ] );
                $logId = $logEntry->insert();
 
-               if ( count( $data['Tags'] ) ) {
+               if ( !empty( $data['Tags'] ) ) {
                        $logEntry->setTags( $data['Tags'] );
                }