Skip to content
Snippets Groups Projects
Commit bea7ffb5 authored by Peter Rotich's avatar Peter Rotich
Browse files

Merge pull request #132 from greezybacon/issue/api-message-plain-text


Use <pre> elements for plain/text API messages

Reviewed-By: default avatarPeter Rotich <peter@osticket.com>
parents 7855484a 2463145b
No related branches found
No related tags found
No related merge requests found
......@@ -337,7 +337,7 @@ class ApiXmlDataParser extends XmlDataParser {
if (isset($value['encoding']))
$value['body'] = Format::utf8encode($value['body'], $value['encoding']);
if (!isset($value['type']) || $value['type'] != 'text/html')
$value = sprintf('<div style="white-space:pre-wrap">%s</div>',
$value = sprintf('<pre>%s</pre>',
Format::htmlchars($value['body']));
else
$value = $value['body'];
......@@ -381,7 +381,7 @@ class ApiJsonDataParser extends JsonDataParser {
// Allow message specified in RFC 2397 format
$data = Format::parseRfc2397($value, 'utf-8');
if (!isset($data['type']) || $data['type'] != 'text/html')
$value = sprintf('<div style="white-space:pre-wrap">%s</div>',
$value = sprintf('<pre>%s</pre>',
Format::htmlchars($data['data']));
else
$value = $data['data'];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment