X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLForm.php;h=702c2ebc7aa52fd3e9ecd39b613f8919691af834;hp=399147b89afe50d46a1fde1b32d001ef699c6f5c;hb=d5a7166771613dfe4ed9fb75fa5efeced6134bd1;hpb=4feb2bd8d6deaee787f11ae8be41c0393934f636 diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 399147b89a..702c2ebc7a 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -285,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; } @@ -400,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 :( @@ -1686,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 { @@ -1735,7 +1741,7 @@ class HTMLForm extends ContextSource { ]; if ( $sectionName ) { - $attribs['id'] = Sanitizer::escapeId( $sectionName ); + $attribs['id'] = Sanitizer::escapeIdForAttribute( $sectionName ); } if ( $displayFormat === 'table' ) {