mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-30 22:18:46 +02:00
Improve utils::Sanitize()
- Add class constants for $sSanitizationFilter values (You should use them instead of hard-coding the value, for example: utils::ENUM_SANIZATION_FILTER_XXX) - Fix "element_identifier" filter of utils::Sanitize() to keep "-" character - Add 'sanitize_identifier' filter to TWIG
This commit is contained in:
@@ -86,6 +86,13 @@ class Extension
|
||||
})
|
||||
);
|
||||
|
||||
// Filter to sanitize an XML / HTML identifier
|
||||
// Usage in twig: {{ 'identifier:to-sanitize' }}
|
||||
$oTwigEnv->addFilter(new Twig_SimpleFilter('sanitize_identifier', function($sString) {
|
||||
return utils::Sanitize($sString, '', utils::ENUM_SANITIZATION_FILTER_ELEMENT_IDENTIFIER);
|
||||
})
|
||||
);
|
||||
|
||||
// Filter to add a parameter at the end of the URL to force cache invalidation after an upgrade.
|
||||
// Previously we put the iTop version but now it's the last setup/toolkit timestamp to avoid cache issues when building several times the same version during tests
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user