Index: trunk/phase3/includes/HTMLForm.php |
— | — | @@ -601,13 +601,18 @@ |
602 | 602 | } |
603 | 603 | |
604 | 604 | function getInputHTML( $value ) { |
605 | | - $select = new XmlSelect( $this->mName, $this->mID, $value ); |
| 605 | + $select = new XmlSelect( $this->mName, $this->mID, strval($value) ); |
606 | 606 | |
| 607 | + // If one of the options' 'name' is int(0), it is automatically selected. |
| 608 | + // because PHP sucks and things int(0) == 'some string'. |
| 609 | + // Working around this by forcing all of them to strings. |
| 610 | + $options = array_map( 'strval', $this->mParams['options'] ); |
| 611 | + |
607 | 612 | if (!empty($this->mParams['disabled'])) { |
608 | 613 | $select->setAttribute( 'disabled', 'disabled' ); |
609 | 614 | } |
610 | 615 | |
611 | | - $select->addOptions( $this->mParams['options'] ); |
| 616 | + $select->addOptions( $options ); |
612 | 617 | |
613 | 618 | return $select->getHTML(); |
614 | 619 | } |