From: Andrew Garrett Date: Wed, 20 Aug 2008 12:30:31 +0000 (+0000) Subject: PHP Sucks. Having a value of 0 was making $value appear as false, so you couldn't... X-Git-Tag: 1.31.0-rc.0~45777 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=e75a08f1bc3455d8fd4ba8f7c1a8b8e22ad22249;p=lhc%2Fweb%2Fwiklou.git PHP Sucks. Having a value of 0 was making $value appear as false, so you couldn't set a value when adding an option. Fixed this up with a strict check. --- diff --git a/includes/Xml.php b/includes/Xml.php index 1551878518..05e93bc3eb 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -674,7 +674,8 @@ class XmlSelect { } public function addOption( $name, $value = false ) { - $value = $value ? $value : $name; + // Stab stab stab + $value = ($value !== false) ? $value : $name; $this->options[] = Xml::option( $name, $value, $value === $this->default ); }