Explorar o código

Prevent the same error from being displayed twice

stevetruckstuff %!s(int64=19) %!d(string=hai) anos
pai
achega
4df9981f2d
Modificáronse 1 ficheiros con 5 adicións e 1 borrados
  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);
         }