mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
N°3565 - Migrate backoffice pages to new UIBlock system : Setup (fix bad escaping)
This commit is contained in:
@@ -132,7 +132,7 @@ class Extension
|
||||
// Filter to sanitize a string (escape ')
|
||||
// Usage in twig: {{ 'string'|escape_for_js_string }}
|
||||
$oTwigEnv->addFilter(new Twig_SimpleFilter('escape_for_js_string', function ($sString) {
|
||||
return str_replace(["\n"], [" "], htmlentities($sString, ENT_QUOTES, 'UTF-8'));
|
||||
return str_replace(["'", '"', "\n"], ["\\'", "\\\"", " "], $sString);
|
||||
})
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user