Happy 2017
[squirrelmail.git] / class / mime / Rfc822Header.class.php
index 717b09de45c364c9cb6a07b5443e0b9cc512e15c..8c30540462eb86d1435f867a6d9ebb99002f6ae0 100644 (file)
@@ -5,7 +5,7 @@
  *
  * This file contains functions needed to handle headers in mime messages.
  *
- * @copyright 2003-2014 The SquirrelMail Project Team
+ * @copyright 2003-2017 The SquirrelMail Project Team
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
  * @version $Id$
  * @package squirrelmail
@@ -970,7 +970,7 @@ class Rfc822Header {
      *    Looks through this list of addresses and
      *    returns the array index (an integer even
      *    if the array is given with keys of a
-     *    different type) of the *last* matching
+     *    different type) of the first matching
      *    $address found in this message's
      *    TO or CC headers, unless there is an exact
      *    match (meaning that the "personal
@@ -1002,10 +1002,10 @@ class Rfc822Header {
             $i=0;
             foreach($address as $argument) {
                 $match = $this->findAddress($argument, true);
-                if ($match[1]) {
+                if ($match[1]) { // this indicates when the personal information matched
                     return $i;
                 } else {
-                    if (count($match[0]) && !$result) {
+                    if (count($match[0]) && $result === FALSE) {
                         $result = $i;
                     }
                 }