summaryrefslogtreecommitdiff
path: root/program/lib
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-09-26 20:05:01 +0200
committerAleksander Machniak <alec@alec.pl>2012-09-26 20:05:01 +0200
commitdc8f292b215719506c2ab0abd8429f4c5ec5c0ed (patch)
tree192ca54a4049b5cc6eda834ba83fdf64a6acd841 /program/lib
parent5f8406c76a1efdc50e5613a49ca10b86873fa436 (diff)
Make sure <head> content (e.g. title) is not converted to plain text
Diffstat (limited to 'program/lib')
-rw-r--r--program/lib/html2text.php2
1 files changed, 2 insertions, 0 deletions
diff --git a/program/lib/html2text.php b/program/lib/html2text.php
index 28c5ae059..dd413e0d6 100644
--- a/program/lib/html2text.php
+++ b/program/lib/html2text.php
@@ -145,6 +145,7 @@ class html2text
var $search = array(
"/\r/", // Non-legal carriage return
"/[\n\t]+/", // Newlines and tabs
+ '/<head[^>]*>.*?<\/head>/i', // <head>
'/<script[^>]*>.*?<\/script>/i', // <script>s -- which strip_tags supposedly has problems with
'/<style[^>]*>.*?<\/style>/i', // <style>s -- which strip_tags supposedly has problems with
'/<p[^>]*>/i', // <P>
@@ -172,6 +173,7 @@ class html2text
var $replace = array(
'', // Non-legal carriage return
' ', // Newlines and tabs
+ '', // <head>
'', // <script>s -- which strip_tags supposedly has problems with
'', // <style>s -- which strip_tags supposedly has problems with
"\n\n", // <P>