浏览代码

Avoid PHP errors when adding to empty list

pdontthink 17 年之前
父节点
当前提交
3e70629b7d
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      functions/options.php

+ 2 - 0
functions/options.php

@@ -647,6 +647,8 @@ function save_option($option) {
     //
     //
     if ($option->type == SMOPT_TYPE_EDIT_LIST) {
     if ($option->type == SMOPT_TYPE_EDIT_LIST) {
 
 
+        if (empty($option->possible_values)) $option->possible_values = array();
+
         // add element if given
         // add element if given
         //
         //
         if (sqGetGlobalVar('add_' . $option->name, $new_element, SQ_POST)) {
         if (sqGetGlobalVar('add_' . $option->name, $new_element, SQ_POST)) {