Commit 6796ef89 authored by mku's avatar mku

ZP-318 #comment Merge contribution - Added Utils::ConvertHtmlToText #time 20m

git-svn-id: https://z-push.org/svn/z-push/trunk@1564 b7dd7b3b-3a3c-0410-9da9-bee62a6cc5b5
parent 73303706
......@@ -849,6 +849,25 @@ class Utils {
if (in_array(SYNC_BODYPREFERENCE_MIME, $bpTypes)) return SYNC_BODYPREFERENCE_MIME;
return SYNC_BODYPREFERENCE_PLAIN;
}
/* BEGIN fmbiete's contribution r1516, ZP-318 */
/**
* Converts a html string into a plain text string
*
* @param string $html
*
* @access public
* @return string
*/
public static function ConvertHtmlToText($html) {
// remove css-style tags
$plaintext = preg_replace("/<style.*?<\/style>/is", "", $html);
// remove all other html
$plaintext = strip_tags($plaintext);
return $plaintext;
}
/* END fmbiete's contribution r1516, ZP-318 */
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment