From e2e56261b977a3f70e2495e860e6e2c387305a15 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 13 Apr 2016 07:08:43 -0400
Subject: [PATCH] Fix handling of long script/style tags when converting to text

---
 program/lib/Roundcube/rcube_html2text.php |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/program/lib/Roundcube/rcube_html2text.php b/program/lib/Roundcube/rcube_html2text.php
index d20d7b7..269d350 100644
--- a/program/lib/Roundcube/rcube_html2text.php
+++ b/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>

--
Gitblit v1.9.1