|
@@ -332,6 +332,7 @@ class message {
|
|
$i++;
|
|
$i++;
|
|
$arg_a[] = $msg->parseDisposition($read,&$i);
|
|
$arg_a[] = $msg->parseDisposition($read,&$i);
|
|
} else {
|
|
} else {
|
|
|
|
+ $i++;
|
|
$arg_a[] = $msg->parseLanguage($read,&$i);
|
|
$arg_a[] = $msg->parseLanguage($read,&$i);
|
|
}
|
|
}
|
|
$arg_no++;
|
|
$arg_no++;
|
|
@@ -339,8 +340,10 @@ class message {
|
|
case 10:
|
|
case 10:
|
|
if ($arg_a[0] == 'text' ||
|
|
if ($arg_a[0] == 'text' ||
|
|
($arg_a[0] == 'message' && $arg_a[1] == 'rfc822')) {
|
|
($arg_a[0] == 'message' && $arg_a[1] == 'rfc822')) {
|
|
|
|
+ $i++;
|
|
$arg_a[] = $msg->parseLanguage($read,&$i);
|
|
$arg_a[] = $msg->parseLanguage($read,&$i);
|
|
} else {
|
|
} else {
|
|
|
|
+ $msg->parseParenthesis($read,&$i);
|
|
$arg_a[] = ''; /* not yet desribed in rfc2060 */
|
|
$arg_a[] = ''; /* not yet desribed in rfc2060 */
|
|
}
|
|
}
|
|
$arg_no++;
|
|
$arg_no++;
|
|
@@ -689,24 +692,34 @@ class message {
|
|
|
|
|
|
function parseLanguage($read,&$i) {
|
|
function parseLanguage($read,&$i) {
|
|
/* no idea how to process this one without examples */
|
|
/* no idea how to process this one without examples */
|
|
- $arg = '';
|
|
|
|
|
|
+ $arg_a = array();
|
|
while ($read{$i} != ')') {
|
|
while ($read{$i} != ')') {
|
|
switch ($read{$i}) {
|
|
switch ($read{$i}) {
|
|
case '"':
|
|
case '"':
|
|
- $arg = $this->parseQuote($read,&$i);
|
|
|
|
|
|
+ $arg_a[] = $this->parseQuote($read,&$i);
|
|
break;
|
|
break;
|
|
case '{':
|
|
case '{':
|
|
- $arg = $this->parseLiteral($read,&$i);
|
|
|
|
|
|
+ $arg_a[] = $this->parseLiteral($read,&$i);
|
|
break;
|
|
break;
|
|
case '(':
|
|
case '(':
|
|
- $arg = $this->parseProperties($read,&$i);
|
|
|
|
|
|
+ $arg_a[] = $this->parseProperties($read,&$i);
|
|
break;
|
|
break;
|
|
default:
|
|
default:
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
$i++;
|
|
$i++;
|
|
}
|
|
}
|
|
- return $arg;;
|
|
|
|
|
|
+ if (isset($arg_a[0])) {
|
|
|
|
+ $lang = new language($arg_a[0]);
|
|
|
|
+ if (isset($arg_a[1])) {
|
|
|
|
+ $lang->properties = $arg_a[1];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (is_object($lang)) {
|
|
|
|
+ return $lang;
|
|
|
|
+ } else {
|
|
|
|
+ return '';
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function parseParenthesis($read,&$i) {
|
|
function parseParenthesis($read,&$i) {
|
|
@@ -856,4 +869,11 @@ class disposition {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+class language {
|
|
|
|
+ function language($name) {
|
|
|
|
+ $this->name = $name;
|
|
|
|
+ $this->properties = array();
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
?>
|
|
?>
|