Fix handling of long script/style tags when converting to text

pull/5209/head
Aleksander Machniak 8 years ago
parent 302aff920c
commit e2e56261b9

@ -137,10 +137,10 @@ class rcube_html2text
*/ */
protected $search = array( protected $search = array(
'/\r/', // Non-legal carriage return '/\r/', // Non-legal carriage return
'/^.*<body[^>]*>\n*/i', // Anything before <body> '/^.*<body[^>]*>\n*/is', // Anything before <body>
'/<head[^>]*>.*?<\/head>/i', // <head> '/<head[^>]*>.*?<\/head>/is', // <head>
'/<script[^>]*>.*?<\/script>/i', // <script> '/<script[^>]*>.*?<\/script>/is', // <script>
'/<style[^>]*>.*?<\/style>/i', // <style> '/<style[^>]*>.*?<\/style>/is', // <style>
'/[\n\t]+/', // Newlines and tabs '/[\n\t]+/', // Newlines and tabs
'/<p[^>]*>/i', // <p> '/<p[^>]*>/i', // <p>
'/<\/p>[\s\n\t]*<div[^>]*>/i', // </p> before <div> '/<\/p>[\s\n\t]*<div[^>]*>/i', // </p> before <div>

Loading…
Cancel
Save