AuthManagerSpecialPage: Don't use fixed submit/info class for submit button check
authorFlorian <florian.schmidt.stargatewissen@gmail.com>
Tue, 7 Jun 2016 20:57:47 +0000 (22:57 +0200)
committerFlorian <florian.schmidt.stargatewissen@gmail.com>
Tue, 7 Jun 2016 20:57:47 +0000 (22:57 +0200)
It's possible that an authentication extension implements its own HTMLForm classes
for a submit button or info field. To omit the default submit button of HTMLForm
in these cases, too, it's necessary to check if one of the provided HTMLForm field
classes inherit from HTMLSubmitField or HTMLInfoField (assuming, that subclasses
in extensions inherit from one of them).

Bug: T137236
Change-Id: Id0ec914088b527a9c7224d545b04986068138f93

includes/specialpage/AuthManagerSpecialPage.php

index 41380f0..9833c73 100644 (file)
@@ -570,7 +570,8 @@ abstract class AuthManagerSpecialPage extends SpecialPage {
                        } elseif ( array_key_exists( 'type', $item ) ) {
                                $class = HTMLForm::$typeMappings[$item['type']];
                        }
-                       return !in_array( $class, [ 'HTMLInfoField', 'HTMLSubmitField' ], true );
+                       return !is_a( $class, \HTMLInfoField::class, true ) &&
+                               !is_a( $class, \HTMLSubmitField::class, true );
                } );
        }