Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently handle emails #29

Merged
merged 3 commits into from Oct 22, 2013

Conversation

greezybacon
Copy link
Contributor

Whether HTML ticket thread is enabled or not, consistently handle the processing of the email bodies

Whether HTML ticket thread is enabled or not, consistently handle the
processing of the email bodies
$body=Format::safe_html($body); //Balance html tags & neutralize unsafe tags.
if (!$cfg->isHtmlThreadEnabled())
$body = convert_html_to_text($body);
if ($cfg->isHtmlThreadEnabled()) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably need to add

if (!trim($body, " <>br/\t\n\r")) return "--";

-- is used to signify to the front-end (when displayed to a user) that no message was given

Provide fallback html2text mechanism if PHP xml extension is not available
@@ -27,6 +27,9 @@
function convert_html_to_text($html, $width=74) {
$html = fix_newlines($html);

if (!extension_loaded('xml'))
return strip_tags($html);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider changing <br>, </div> & </p> to new lines before stripping tags.

If the xml extension for php is not loaded, this patch will do a better job
of honoring line break hints in the html.
protich added a commit that referenced this pull request Oct 22, 2013
Consistently handle emails

Reviewed-By: Peter Rotich <peter@osticket.com>
@protich protich merged commit d8012dc into osTicket:develop Oct 22, 2013
protich added a commit that referenced this pull request Jul 20, 2018
JoshBeckerPLCH pushed a commit to plch/osTicket that referenced this pull request Feb 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants