Esempio n. 1
0
 public function _getXML_helper($hdr_name, $hdr_value, $indent)
 {
     $htab = "\t";
     $crlf = "\r\n";
     $return = "";
     $new_hdr_value = $hdr_name != "received" ? Mail_mimeDecode::_parseheadervalue($hdr_value) : array("value" => $hdr_value);
     $new_hdr_name = str_replace(" ", "-", ucwords(str_replace("-", " ", $hdr_name)));
     if (!empty($new_hdr_value["other"])) {
         foreach ($new_hdr_value["other"] as $paramname => $paramvalue) {
             $params[] = str_repeat($htab, $indent) . $htab . "<parameter>" . $crlf . str_repeat($htab, $indent) . $htab . $htab . "<paramname>" . htmlspecialchars($paramname) . "</paramname>" . $crlf . str_repeat($htab, $indent) . $htab . $htab . "<paramvalue>" . htmlspecialchars($paramvalue) . "</paramvalue>" . $crlf . str_repeat($htab, $indent) . $htab . "</parameter>" . $crlf;
         }
         $params = implode("", $params);
     } else {
         $params = "";
     }
     $return = str_repeat($htab, $indent) . "<header>" . $crlf . str_repeat($htab, $indent) . $htab . "<headername>" . htmlspecialchars($new_hdr_name) . "</headername>" . $crlf . str_repeat($htab, $indent) . $htab . "<headervalue>" . htmlspecialchars($new_hdr_value["value"]) . "</headervalue>" . $crlf . $params . str_repeat($htab, $indent) . "</header>" . $crlf;
     return $return;
 }