From: pdontthink Date: Fri, 31 Aug 2007 23:19:36 +0000 (+0000) Subject: Make identities matching case insensitive X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=commitdiff_plain;h=8d2d85f59ea194a546f9d843dbaaaea1b76f5ac7 Make identities matching case insensitive git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12655 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- diff --git a/class/mime/Rfc822Header.class.php b/class/mime/Rfc822Header.class.php index eed274fd..2cc08f70 100644 --- a/class/mime/Rfc822Header.class.php +++ b/class/mime/Rfc822Header.class.php @@ -935,6 +935,7 @@ class Rfc822Header { } /** +//FIXME: This needs some documentation (inside the function too)! Don't code w/out comments! * @param mixed $address array or string * @param boolean $recurs * @return mixed array, boolean @@ -960,10 +961,10 @@ class Rfc822Header { $srch_addr = $this->parseAddress($address); $results = array(); foreach ($this->to as $to) { - if ($to->host == $srch_addr->host) { - if ($to->mailbox == $srch_addr->mailbox) { + if (strtolower($to->host) == strtolower($srch_addr->host)) { + if (strtolower($to->mailbox) == strtolower($srch_addr->mailbox)) { $results[] = $srch_addr; - if ($to->personal == $srch_addr->personal) { + if (strtolower($to->personal) == strtolower($srch_addr->personal)) { if ($recurs) { return array($results, true); } else { @@ -974,10 +975,10 @@ class Rfc822Header { } } foreach ($this->cc as $cc) { - if ($cc->host == $srch_addr->host) { - if ($cc->mailbox == $srch_addr->mailbox) { + if (strtolower($cc->host) == strtolower($srch_addr->host)) { + if (strtolower($cc->mailbox) == strtolower($srch_addr->mailbox)) { $results[] = $srch_addr; - if ($cc->personal == $srch_addr->personal) { + if (strtolower($cc->personal) == strtolower($srch_addr->personal)) { if ($recurs) { return array($results, true); } else { diff --git a/src/compose.php b/src/compose.php index 52f9a489..a5f1211c 100644 --- a/src/compose.php +++ b/src/compose.php @@ -855,7 +855,7 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se if (count($idents) > 1) { foreach($idents as $nr=>$data) { $enc_from_name = '"'.$data['full_name'].'" <'. $data['email_address'].'>'; - if($enc_from_name == $orig_from) { + if(strtolower($enc_from_name) == strtolower($orig_from)) { $identity = $nr; break; }