2
0
forked from Wavyzz/dolibarr

Fix: html detection was not working with hx tags.

This commit is contained in:
Laurent Destailleur
2014-05-24 14:57:41 +02:00
parent 2a6b2a4540
commit 872e764c94
2 changed files with 9 additions and 5 deletions

View File

@@ -3673,6 +3673,7 @@ function dol_textishtml($msg,$option=0)
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)>/i',$msg)) return true;
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*>/i',$msg)) return true;
elseif (preg_match('/<(br|div|font|img|li|span|strong|table)\s+[^<>\/]*\/>/i',$msg)) return true;
elseif (preg_match('/<h[0-9]>/i',$msg)) return true;
elseif (preg_match('/&[A-Z0-9]{1,6};/i',$msg)) return true; // Html entities names (http://www.w3schools.com/tags/ref_entities.asp)
elseif (preg_match('/&#[0-9]{2,3};/i',$msg)) return true; // Html entities numbers (http://www.w3schools.com/tags/ref_entities.asp)
return false;
@@ -4532,4 +4533,4 @@ function natural_search($fields, $value)
return " AND " . ($end > 1? '(' : '') . $res;
}
?>
?>