From bbb92b4c9ae9b0d54216c109437fe7dfadb76b12 Mon Sep 17 00:00:00 2001 From: indiri69 Date: Sat, 30 Oct 2004 21:12:13 +0000 Subject: [PATCH] Check and make sure the header property value is actually set to something before testing its first character. Fixes an undefined offset error when reading badly formed emails. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8277 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- ChangeLog | 1 + class/mime/Rfc822Header.class.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9cc82fb4..7626f47c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -138,6 +138,7 @@ Version 1.5.1 -- CVS - Fixed SquirrelSpell error output. Patch courtesy David Boone. - Fixed bug in IMAP read routines that treated "0" as false instead of a string (patch courtesy Maurice Makaay). + - Fixed PHP notice when header property value is blank Version 1.5.0 -------------------- diff --git a/class/mime/Rfc822Header.class.php b/class/mime/Rfc822Header.class.php index 5ff139eb..40b93913 100644 --- a/class/mime/Rfc822Header.class.php +++ b/class/mime/Rfc822Header.class.php @@ -568,7 +568,7 @@ class Rfc822Header { if ($pos > 0) { $key = trim(substr($prop, 0, $pos)); $val = trim(substr($prop, $pos+1)); - if ($val{0} == '"') { + if (strlen($val) > 0 && $val{0} == '"') { $val = substr($val, 1, -1); } $propResultArray[$key] = $val; @@ -753,4 +753,4 @@ class Rfc822Header { } } -?> \ No newline at end of file +?> -- 2.25.1