diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index cf4b19d3aa6..90698c95f80 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -955,8 +955,8 @@ function sanitizeVal($out = '', $check = 'alphanohtml', $filter = null, $options
// Restore entity ' into ' (restricthtml is for html content so we can use html entity)
$out = preg_replace('/'/i', "'", $out);
- preg_match_all('/(
(getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT") ? getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT") : 1000)) {
+ preg_match_all('/(
getDolGlobalInt("MAIN_SECURITY_MAX_IMG_IN_HTML_CONTENT", 1000)) {
$out = '';
}
} while ($oldstringtoclean != $out);