X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLForm.php;h=702c2ebc7aa52fd3e9ecd39b613f8919691af834;hb=fd6e9ef2d481209b01fa6e1bb1c863b8257f0272;hp=e627cfdc690303e78c04f7e948fdca4ce22e28a0;hpb=c186988a83c405b7da5e2607d15dd6d535a16550;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index e627cfdc69..702c2ebc7a 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -165,6 +165,7 @@ class HTMLForm extends ContextSource { 'url' => 'HTMLTextField', 'title' => 'HTMLTitleTextField', 'user' => 'HTMLUserTextField', + 'usersmultiselect' => 'HTMLUsersMultiselectField', ]; public $mFieldData; @@ -284,7 +285,7 @@ class HTMLForm extends ContextSource { return ObjectFactory::constructClassInstance( OOUIHTMLForm::class, $arguments ); default: /** @var HTMLForm $form */ - $form = ObjectFactory::constructClassInstance( HTMLForm::class, $arguments ); + $form = ObjectFactory::constructClassInstance( self::class, $arguments ); $form->setDisplayFormat( $displayFormat ); return $form; } @@ -399,7 +400,13 @@ class HTMLForm extends ContextSource { if ( !in_array( $format, $this->availableDisplayFormats, true ) ) { throw new MWException( 'Display format must be one of ' . - print_r( $this->availableDisplayFormats, true ) ); + print_r( + array_merge( + $this->availableDisplayFormats, + $this->availableSubclassDisplayFormats + ), + true + ) ); } // Evil hack for mobile :( @@ -1258,7 +1265,7 @@ class HTMLForm extends ContextSource { * * @param string|array|Status $elements The set of errors/warnings to process. * @param string $elementsType Should warnings or errors be returned. This is meant - * for Status objects, all other valid types are always considered as errors. + * for Status objects, all other valid types are always considered as errors. * @return string */ public function getErrorsOrWarnings( $elements, $elementsType ) { @@ -1685,7 +1692,7 @@ class HTMLForm extends ContextSource { $attributes = []; if ( $fieldsetIDPrefix ) { - $attributes['id'] = Sanitizer::escapeId( "$fieldsetIDPrefix$key" ); + $attributes['id'] = Sanitizer::escapeIdForAttribute( "$fieldsetIDPrefix$key" ); } $subsectionHtml .= $this->wrapFieldSetSection( $legend, $section, $attributes ); } else { @@ -1734,7 +1741,7 @@ class HTMLForm extends ContextSource { ]; if ( $sectionName ) { - $attribs['id'] = Sanitizer::escapeId( $sectionName ); + $attribs['id'] = Sanitizer::escapeIdForAttribute( $sectionName ); } if ( $displayFormat === 'table' ) {