From 6ee6f7ba2282624134348eb73a372857d348518d Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 2 Aug 2011 11:13:03 -0500 Subject: [PATCH] Refactor messages class. --- system/messages.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/system/messages.php b/system/messages.php index f73036b4..2bfb930e 100644 --- a/system/messages.php +++ b/system/messages.php @@ -30,8 +30,7 @@ public function __construct($messages = array()) */ public function add($key, $message) { - // Make sure the message is not duplicated. - if ( ! array_key_exists($key, $this->messages) or ! is_array($this->messages[$key]) or ! in_array($message, $this->messages[$key])) + if ( ! isset($this->messages[$key]) or array_search($message, $this->messages[$key]) === false) { $this->messages[$key][] = $message; }