Topic: Apply 'keep_bad' setting to tags that do not match regex for HTML tags
--- trunk/phpgwapi/inc/htmLawed/htmLawed.php 2012/07/27 09:59:49 39957
+++ trunk/phpgwapi/inc/htmLawed/htmLawed.php 2012/07/27 10:17:06 39958
@@ -412,7 +412,9 @@
if($t == '< '){return '< ';}
if($t == '>'){return '>';}
if(!preg_match('`^<(/?)([a-zA-Z][a-zA-Z1-6]*)([^>]*?)\s?>$`m', $t, $m)){
- return str_replace(array('<', '>'), array('<', '>'), $t);
+ return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('<', '>'), $t) : '');
}elseif(!isset($C['elements'][($e = strtolower($m[2]))])){
return (($C['keep_bad']%2) ? str_replace(array('<', '>'), array('<', '>'), $t) : '');
}
That way one will be able to decide to what extent one wants to keep the content or tags of stuff like
<![if !vml]> some stuff <![endif]>