j__ Posted March 10, 2019 Posted March 10, 2019 Hi, probably quite simple, but I just can't get my head around this: I've got a string containing non-ASCII characters which I would like to have replaced based on InputfieldPageName module config settings (ä -> ae, á -> a, etc.). Apparenty Sanitizer::translate seems to be usable for PageName only, as in $sanitizer->pageName(string $value). But in this case PageName would limit the string length and replace all space characters with '-', which I do not want. So in short I am looking for $sanitizer->text(string $value, Sanitizer::translate), but it does not exist. What could I do?
Robin S Posted March 11, 2019 Posted March 11, 2019 13 hours ago, j__ said: I would like to have replaced based on InputfieldPageName module config settings These settings probably wouldn't be ideal for the purpose because they only account for lowercase replacements (page names must be lowercase). But it seemed like a good candidate for a new sanitizer method so I made a module where you can define character replacements in the config: 5
j__ Posted March 11, 2019 Author Posted March 11, 2019 Wow, Robin, that's astonishing! Thank you very much! 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now