]> git.mjollnir.org Git - moodle.git/commitdiff
tags formslib element: MDL-19264 array_combine barfs on empty arrays.
authortjhunt <tjhunt>
Tue, 2 Jun 2009 08:33:35 +0000 (08:33 +0000)
committertjhunt <tjhunt>
Tue, 2 Jun 2009 08:33:35 +0000 (08:33 +0000)
lib/form/tags.php

index 93c626903fc1f2710f73fe74c46134fe88baa6c9..fd24a8b5bd70174ffe0e6a9401167ba500e8a33b 100644 (file)
@@ -176,7 +176,11 @@ class MoodleQuickForm_tags extends MoodleQuickForm_group {
                     $other = array();
                     if ($this->_options['display'] != MoodleQuickForm_tags::NOOFFICIAL) {
                         $this->_load_official_tags();
-                        $officaltags = array_combine($this->_officialtags, $this->_officialtags);
+                        if (!empty($this->_officialtags)) {
+                            $officaltags = array_combine($this->_officialtags, $this->_officialtags);
+                        } else {
+                            $officaltags = array();
+                        }
                         foreach ($value as $tag) {
                             if (isset($officaltags[$tag])) {
                                 $official[] = $tag;