dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4843586
)
Fix for string/int inconsistency in value and option for imagesize, resulting in...
author
Andrew Garrett
<werdna@users.mediawiki.org>
Wed, 17 Jun 2009 19:08:14 +0000
(19:08 +0000)
committer
Andrew Garrett
<werdna@users.mediawiki.org>
Wed, 17 Jun 2009 19:08:14 +0000
(19:08 +0000)
includes/HTMLForm.php
patch
|
blob
|
history
diff --git
a/includes/HTMLForm.php
b/includes/HTMLForm.php
index
04b36da
..
ba44003
100644
(file)
--- a/
includes/HTMLForm.php
+++ b/
includes/HTMLForm.php
@@
-601,13
+601,18
@@
class HTMLSelectField extends HTMLFormField {
}
function getInputHTML( $value ) {
}
function getInputHTML( $value ) {
- $select = new XmlSelect( $this->mName, $this->mID, $value );
+ $select = new XmlSelect( $this->mName, $this->mID, strval($value) );
+
+ // If one of the options' 'name' is int(0), it is automatically selected.
+ // because PHP sucks and things int(0) == 'some string'.
+ // Working around this by forcing all of them to strings.
+ $options = array_map( 'strval', $this->mParams['options'] );
if (!empty($this->mParams['disabled'])) {
$select->setAttribute( 'disabled', 'disabled' );
}
if (!empty($this->mParams['disabled'])) {
$select->setAttribute( 'disabled', 'disabled' );
}
- $select->addOptions( $
this->mParams['options']
);
+ $select->addOptions( $
options
);
return $select->getHTML();
}
return $select->getHTML();
}