Skip to content
Snippets Groups Projects
Commit 4f4851ac authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

Improved multiple headers support.

Rev: src/modules/MIME/module.pmod.in:1.12
parent 9ac1fe58
No related branches found
No related tags found
No related merge requests found
/*
* $Id: module.pmod.in,v 1.11 1998/02/15 01:22:57 mirar Exp $
* $Id: module.pmod.in,v 1.12 1998/07/08 19:02:36 grubba Exp $
*
* RFC1521 functionality for Pike
*
......@@ -307,7 +307,7 @@ class Message {
}
void create(void | string message,
void | mapping(string:string) hdrs,
void | mapping(string:string|array(string)) hdrs,
void | array(object) parts,
void | int use_multiple_headers)
{
......@@ -323,10 +323,23 @@ class Message {
boundary = 0;
disposition = 0;
if (hdrs || parts) {
string hname;
string|array(string) hname;
decoded_data = message;
if (hdrs)
foreach( indices(hdrs), hname )
if (use_multiple_headers) {
if (headers[lower_case(hname)]) {
array(string)|string to_add;
if (!arrayp(to_add = hdrs[hname]))
to_add = ({ to_add });
if (!arrayp(headers[lower_case(hname)]))
headers[lower_case(hname)] = ({ headers[lower_case(hname)] }) +
to_add;
else
headers[lower_case(hname)] += to_add;
} else
headers[lower_case(hname)] = hdrs[hname];
} else
headers[lower_case(hname)] = hdrs[hname];
body_parts = parts;
} else if (message) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment