Bug: T201747
Change-Id: I7772f1e8c0c12bdf1fd60d62e015f2ec82d8ac90
=== Other changes in 1.33 ===
* (T208871) The hard-coded Google search form on the database error page was
removed.
+* (T201747) Html::openElement() warns if given an element name wiht a space
+ in it.
* …
== Compatibility ==
// consistency and better compression.
$element = strtolower( $element );
+ // Some people were abusing this by passing things like
+ // 'h1 id="foo" to $element, which we don't want.
+ if ( strpos( $element, ' ' ) !== false ) {
+ wfWarn( __METHOD__ . " given element name with space '$element'" );
+ }
+
// Remove invalid input types
if ( $element == 'input' ) {
$validTypes = [
parent::tearDown();
}
+ /**
+ * @expectedException PHPUnit_Framework_Error_Notice
+ * @expectedExceptionMessage given element name with space
+ * @covers Html::openElement
+ */
+ public function testOpenElement() {
+ Html::openElement( 'span id="x"' );
+ }
+
/**
* @covers Html::element
* @covers Html::rawElement