X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=includes%2Fhtmlform%2FHTMLForm.php;h=465736bb0620b428ae42bf258481bc14043f147c;hp=61d0d8962cbc8c0746fc46c4224b72977d498f63;hb=802c199d0bd80ff0f4d730c61fd58cbf08a52d8d;hpb=a8dcb178c7e347ef56bef1e36bb4a26a61a1d82b diff --git a/includes/htmlform/HTMLForm.php b/includes/htmlform/HTMLForm.php index 61d0d8962c..465736bb06 100644 --- a/includes/htmlform/HTMLForm.php +++ b/includes/htmlform/HTMLForm.php @@ -271,7 +271,7 @@ class HTMLForm extends ContextSource { * Construct a HTMLForm object for given display type. May return a HTMLForm subclass. * * @param string $displayFormat - * @param mixed $arguments... Additional arguments to pass to the constructor. + * @param mixed $arguments,... Additional arguments to pass to the constructor. * @return HTMLForm */ public static function factory( $displayFormat/*, $arguments...*/ ) { @@ -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 :( @@ -444,7 +450,7 @@ class HTMLForm extends ContextSource { * @since 1.23 * * @param string $fieldname Name of the field - * @param array $descriptor Input Descriptor, as described above + * @param array &$descriptor Input Descriptor, as described above * * @throws MWException * @return string Name of a HTMLFormField subclass @@ -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' ) { @@ -1887,7 +1893,7 @@ class HTMLForm extends ContextSource { * 'novalidate' attribute will be added on the `
` element. It will be removed if the user * agent has JavaScript support, in htmlform.js. * - * @return boolean + * @return bool * @since 1.29 */ public function needsJSForHtml5FormValidation() {