Now running auto-generated id/names for radio group items through Sanitizer::escapeId().
For good measure, also manually checking the input 'name' and 'id' field values for base fields against validation and throwing an exception if we ain't got em.
standard, nostalgia and cologneblue skin
* (bug 19814) interwiki links from file links ([[File:Foo.jpg|link=de:Test]])
are no longer recorded in the pagelinks table
standard, nostalgia and cologneblue skin
* (bug 19814) interwiki links from file links ([[File:Foo.jpg|link=de:Test]])
are no longer recorded in the pagelinks table
+* (bug 19784) date option "ISO 8601" produced illegal id
== API changes in 1.16 ==
== API changes in 1.16 ==
}
if ( isset( $params['name'] ) ) {
}
if ( isset( $params['name'] ) ) {
- $this->mName = 'wp'.$params['name'];
- $this->mID = 'mw-input-'.$params['name'];
+ $name = $params['name'];
+ $validName = Sanitizer::escapeId( $name );
+ if( $name != $validName ) {
+ throw new MWException("Invalid name '$name' passed to " . __METHOD__ );
+ }
+ $this->mName = 'wp'.$name;
+ $this->mID = 'mw-input-'.$name;
}
if ( isset( $params['default'] ) ) {
}
if ( isset( $params['default'] ) ) {
}
if ( isset( $params['id'] ) ) {
}
if ( isset( $params['id'] ) ) {
- $this->mID = $params['id'];
+ $id = $params['id'];
+ $validId = Sanitizer::escapeId( $id );
+ if( $id != $validId ) {
+ throw new MWException("Invalid id '$id' passed to " . __METHOD__ );
+ }
+ $this->mID = $id;
}
if ( isset( $params['validation-callback'] ) ) {
}
if ( isset( $params['validation-callback'] ) ) {
$html .= Xml::tags( 'h1', null, $label ) . "\n";
$html .= $this->formatOptions( $info, $value );
} else {
$html .= Xml::tags( 'h1', null, $label ) . "\n";
$html .= $this->formatOptions( $info, $value );
} else {
+ $id = Sanitizer::escapeId( $this->mID . "-$info" );
$html .= Xml::radio( $this->mName, $info, $info == $value,
$html .= Xml::radio( $this->mName, $info, $info == $value,
- $attribs + array( 'id' => $this->mID . "-$info" ) );
+ $attribs + array( 'id' => $id ) );
- Xml::tags( 'label', array( 'for' => $this->mID . "-$info" ), $label );
+ Xml::tags( 'label', array( 'for' => $id ), $label );