projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fixed some html errors, added endlines
[squirrelmail.git]
/
functions
/
mime.php
diff --git
a/functions/mime.php
b/functions/mime.php
index 25dcca5385d5a2808459b7660dc0991e2bc94f76..3bae25afc97c7b25fac5f1b746c2161548e2c3b4 100644
(file)
--- a/
functions/mime.php
+++ b/
functions/mime.php
@@
-65,11
+65,12
@@
$read = fgets ($imap_stream, 10000);
$response = substr($read, 0, 4);
}
$read = fgets ($imap_stream, 10000);
$response = substr($read, 0, 4);
}
- $read = strtolower($bodystructure);
+ // $read = strtolower($bodystructure);
+ $read = $bodystructure;
- if ($debug_mime) echo "<tt>$read</tt><br><br>";
+ if ($debug_mime) echo "<tt>$read</tt><br><br>
\n
";
// isolate the body structure and remove beginning and end parenthesis
// isolate the body structure and remove beginning and end parenthesis
- $read = trim(substr ($read, strpos(
$read
, "bodystructure") + 13));
+ $read = trim(substr ($read, strpos(
strtolower($read)
, "bodystructure") + 13));
$read = trim(substr ($read, 0, -1));
$end = mime_match_parenthesis(0, $read);
while ($end == strlen($read)-1) {
$read = trim(substr ($read, 0, -1));
$end = mime_match_parenthesis(0, $read);
while ($end == strlen($read)-1) {
@@
-78,7
+79,7
@@
$end = mime_match_parenthesis(0, $read);
}
$end = mime_match_parenthesis(0, $read);
}
- if ($debug_mime) echo "<tt>$read</tt><br><br>";
+ if ($debug_mime) echo "<tt>$read</tt><br><br>
\n
";
$msg = mime_parse_structure ($read, 0);
$msg->header = $header;
$msg = mime_parse_structure ($read, 0);
$msg->header = $header;
@@
-94,7
+95,7
@@
// to mime_get_elements()
function mime_parse_structure ($structure, $ent_id) {
global $debug_mime;
// to mime_get_elements()
function mime_parse_structure ($structure, $ent_id) {
global $debug_mime;
- if ($debug_mime) echo "<font color=008800><tt>START: mime_parse_structure()</tt></font><br>";
+ if ($debug_mime) echo "<font color=008800><tt>START: mime_parse_structure()</tt></font><br>
\n
";
$msg = new message();
if (substr($structure, 0, 1) == "(") {
$ent_id = mime_new_element_level($ent_id);
$msg = new message();
if (substr($structure, 0, 1) == "(") {
$ent_id = mime_new_element_level($ent_id);
@@
-160,7
+161,7
@@
$structure = trim($structure);
$char = substr($structure, 0, 1);
$structure = trim($structure);
$char = substr($structure, 0, 1);
- if (s
ubstr($structure, 0, 3
) == "nil") {
+ if (s
trtolower(substr($structure, 0, 3)
) == "nil") {
$text = "";
$structure = substr($structure, 3);
} else if ($char == "\"") {
$text = "";
$structure = substr($structure, 3);
} else if ($char == "\"") {
@@
-195,20
+196,20
@@
// This is where all the text parts get put into the header
switch ($elem_num) {
case 1:
// This is where all the text parts get put into the header
switch ($elem_num) {
case 1:
- $msg->header->type0 =
$text
;
- if ($debug_mime) echo "<tt>type0 =
$text
</tt><br>";
+ $msg->header->type0 =
strtolower($text)
;
+ if ($debug_mime) echo "<tt>type0 =
".strtolower($text)."
</tt><br>";
break;
case 2:
break;
case 2:
- $msg->header->type1 =
$text
;
- if ($debug_mime) echo "<tt>type1 =
$text
</tt><br>";
+ $msg->header->type1 =
strtolower($text)
;
+ if ($debug_mime) echo "<tt>type1 =
".strtolower($text)."
</tt><br>";
break;
case 5:
$msg->header->description = $text;
if ($debug_mime) echo "<tt>description = $text</tt><br>";
break;
case 6:
break;
case 5:
$msg->header->description = $text;
if ($debug_mime) echo "<tt>description = $text</tt><br>";
break;
case 6:
- $msg->header->encoding =
$text
;
- if ($debug_mime) echo "<tt>encoding =
$text
</tt><br>";
+ $msg->header->encoding =
strtolower($text)
;
+ if ($debug_mime) echo "<tt>encoding =
".strtolower($text)."
</tt><br>";
break;
case 7:
$msg->header->size = $text;
break;
case 7:
$msg->header->size = $text;
@@
-306,7
+307,7
@@
$structure = trim(substr($structure, strlen($tmp) + 2));
$k = count($props);
$structure = trim(substr($structure, strlen($tmp) + 2));
$k = count($props);
- $props[$k]["name"] =
$tmp
;
+ $props[$k]["name"] =
strtolower($tmp)
;
$props[$k]["value"] = $value;
} else if ($char == "(") {
$end = mime_match_parenthesis (0, $structure);
$props[$k]["value"] = $value;
} else if ($char == "(") {
$end = mime_match_parenthesis (0, $structure);