diff options
Diffstat (limited to 'core/Translation/Translator.php')
-rw-r--r-- | core/Translation/Translator.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/Translation/Translator.php b/core/Translation/Translator.php index 4d8f6932c6..e58998c803 100644 --- a/core/Translation/Translator.php +++ b/core/Translation/Translator.php @@ -61,6 +61,17 @@ class Translator } /** + * Clean a string that may contain HTML special chars, single/double quotes, HTML entities, leading/trailing whitespace + * + * @param string $s + * @return string + */ + public static function clean($s) + { + return html_entity_decode(trim($s), ENT_QUOTES, 'UTF-8'); + } + + /** * Returns an internationalized string using a translation ID. If a translation * cannot be found for the ID, the ID is returned. * |