]> git.mjollnir.org Git - moodle.git/commitdiff
outputcomponents MDL-21020 Fixed error if html_select_option text = 0
authorSam Hemelryk <sam@moodle.com>
Wed, 2 Dec 2009 07:41:01 +0000 (07:41 +0000)
committerSam Hemelryk <sam@moodle.com>
Wed, 2 Dec 2009 07:41:01 +0000 (07:41 +0000)
lib/outputcomponents.php

index bc55c49632c9981ebc274fb8353b911b212a06c1..f9faada944d99b41804a8df4571bf1af18119173 100644 (file)
@@ -781,7 +781,7 @@ class html_select_option extends labelled_html_component {
      * @return void
      */
     public function prepare() {
-        if (empty($this->text)) {
+        if (empty($this->text) && (string)$this->text!=='0') {
             throw new coding_exception('html_select_option requires a $text value.');
         }