浏览代码

Prevent the same error from being displayed twice

stevetruckstuff 19 年之前
父节点
当前提交
4df9981f2d
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      class/error.class.php

+ 5 - 1
class/error.class.php

@@ -244,7 +244,11 @@ class ErrorHandler {
         }
 
         if (isset($this->Template->values['aErrors']) && count($this->Template->values['aErrors']) > 0) {
-            $this->aErrors = array_merge($this->aErrors, $this->Template->values['aErrors']);
+            foreach ($this->Template->values['aErrors'] as $err) {
+                if (!in_array($err, $this->aErrors, true)) {
+                    $this->aErrors[] = $err;
+                }
+            }
             $this->Template->assign('aErrors',$this->aErrors);
         }