r60072 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60071‎ | r60072 | r60073 >
Date:11:23, 15 December 2009
Author:demon
Status:ok
Tags:
Comment:
(bug 11777) Multiple inputboxes make page invalid due to repetitive similar id. Let users specify an ID like we do for the search box, otherwise omit it entirely
Modified paths:
  • /trunk/extensions/InputBox/InputBox.classes.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InputBox/InputBox.classes.php
@@ -287,15 +287,16 @@
288288 'style' => 'background-color:' . $this->mBGColor
289289 )
290290 );
291 - $htmlOut .= Xml::openElement( 'form',
292 - array(
293 - 'name' => 'createbox',
294 - 'id' => 'createbox',
295 - 'class' => 'createbox',
296 - 'action' => $wgScript,
297 - 'method' => 'get'
298 - )
 291+ $createBoxParams = array(
 292+ 'name' => 'createbox',
 293+ 'class' => 'createbox',
 294+ 'action' => $wgScript,
 295+ 'method' => 'get'
299296 );
 297+ if( isset( $this->mId ) ) {
 298+ $createBoxParams['id'] = Sanitizer::escapeId( $this->mId );
 299+ }
 300+ $htmlOut .= Xml::openElement( 'form', $createBoxParams );
300301 $htmlOut .= Xml::openElement( 'input',
301302 array(
302303 'type' => 'hidden',
@@ -381,15 +382,16 @@
382383 'style' => 'background-color:' . $this->mBGColor
383384 )
384385 );
385 - $htmlOut .= Xml::openElement( 'form',
386 - array(
387 - 'name' => 'commentbox',
388 - 'id' => 'commentbox',
389 - 'class' => 'commentbox',
390 - 'action' => $wgScript,
391 - 'method' => 'get'
392 - )
 386+ $commentFormParams = array(
 387+ 'name' => 'commentbox',
 388+ 'class' => 'commentbox',
 389+ 'action' => $wgScript,
 390+ 'method' => 'get'
393391 );
 392+ if( isset( $this->mId ) ) {
 393+ $commentFormParams['id'] = Sanitizer::escapeId( $this->mId );
 394+ }
 395+ $htmlOut .= Xml::openElement( 'form', $commentFormParams );
394396 $htmlOut .= Xml::openElement( 'input',
395397 array(
396398 'type' => 'hidden',

Status & tagging log