From e7d1b64b894bf2035e654aa041b5bcb09643ba22 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 31 May 2012 14:23:56 +0000 Subject: [PATCH] only call replace routines if the string to match occurs --- felamimail/inc/class.felamimail_bo.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/felamimail/inc/class.felamimail_bo.inc.php b/felamimail/inc/class.felamimail_bo.inc.php index b9627cfad6..2389e073ea 100644 --- a/felamimail/inc/class.felamimail_bo.inc.php +++ b/felamimail/inc/class.felamimail_bo.inc.php @@ -4243,7 +4243,8 @@ class felamimail_bo $singleBodyPart['body'], strtolower($singleBodyPart['charSet']) ); - $ct = preg_match_all('#(.+)#isU', $singleBodyPart['body'], $newStyle); + $ct = 0; + if (stripos($singleBodyPart['body'],'(.+)#isU', $singleBodyPart['body'], $newStyle); if ($ct>0) { //error_log(__METHOD__.__LINE__.array2string($newStyle[0])); @@ -4267,7 +4268,7 @@ class felamimail_bo // CSS Security // http://code.google.com/p/browsersec/wiki/Part1#Cascading_stylesheets $css = preg_replace('/(javascript|expession|-moz-binding)/i','',$style); - felamimail_bo::replaceTagsCompletley($css,'script'); // Strip out script that may be included + if (stripos($css,'script')!==false) felamimail_bo::replaceTagsCompletley($css,'script'); // Strip out script that may be included // we need this, as styledefinitions are enclosed with curly brackets; and template stuuff tries to replace everything between curly brackets that is having no horizontal whitespace $css = str_replace(':',': ',$css); //error_log(__METHOD__.__LINE__.$css);