i found problem with html_clean function

when used tag <style> inside <body> then text before </style> are drops

example:
<body>
some text
<style>some style </style>
another text
</body>

result after html_clean just:
another text


I know style must be inside the head section, but normal email client just
skip this tag inside body.
so we also should do this.
attached patch resolve this problem.

Problem appear with quoted email from zimbra web interface.
diff -Naur ./glpi.old/inc/common.function.php ./glpi/inc/common.function.php 
--- ./glpi.old/inc/common.function.php  2009-08-07 01:10:00.000000000 +0400 
+++ ./glpi/inc/common.function.php      2009-09-11 17:53:24.000000000 +0400 
@@ -1041,7 +1041,7 @@ 
        $value = preg_replace("/<(p|br)( [^>]*)?".">/i", "\n", $value); 
  
        $search = array('@<script[^>]*?>.*?</script[^>]*?>@si',  // Strip out javascript 
-               '@<style[^>]*?>.*?</style[^>]*?>@siU',    // Strip style tags properly 
+               '@<style[^>]*?>.*?</style[^>]*?>@si',    // Strip style tags properly 
                '@<[\/\!]*?[^<>]*?>@si',            // Strip out HTML tags 
                '@<![\s\S]*?--[ \t\n\r]*>@'        // Strip multi-line comments including CDATA 
        ); 

_______________________________________________
Glpi-dev mailing list
Glpi-dev@gna.org
https://mail.gna.org/listinfo/glpi-dev

Reply via email to