Aleksander Machniak
2016-04-13 e2e56261b977a3f70e2495e860e6e2c387305a15
Fix handling of long script/style tags when converting to text
1 files modified
8 ■■■■ changed files
program/lib/Roundcube/rcube_html2text.php 8 ●●●● patch | view | raw | blame | history
program/lib/Roundcube/rcube_html2text.php
@@ -137,10 +137,10 @@
     */
    protected $search = array(
        '/\r/',                                  // Non-legal carriage return
        '/^.*<body[^>]*>\n*/i',                  // Anything before <body>
        '/<head[^>]*>.*?<\/head>/i',             // <head>
        '/<script[^>]*>.*?<\/script>/i',         // <script>
        '/<style[^>]*>.*?<\/style>/i',           // <style>
        '/^.*<body[^>]*>\n*/is',                 // Anything before <body>
        '/<head[^>]*>.*?<\/head>/is',            // <head>
        '/<script[^>]*>.*?<\/script>/is',        // <script>
        '/<style[^>]*>.*?<\/style>/is',          // <style>
        '/[\n\t]+/',                             // Newlines and tabs
        '/<p[^>]*>/i',                           // <p>
        '/<\/p>[\s\n\t]*<div[^>]*>/i',           // </p> before <div>