| Re: Module translation and special characters |
| by zyspec on 2021/12/1 16:01:11 Glad the explanation helped. In this case Cedric's change should fix this particular issue. |
| Re: Module translation and special characters |
| by alain01 on 2021/12/1 10:50:00 yes I had seen but I didn't understand Cedric's explanation in the PR. With the additional explanation given by Zyspec, it is clear and I now understand Cedric's explanation
|
| Re: Module translation and special characters |
| by Cesagonchu on 2021/12/1 10:37:48 To solve the problem, Cedric made a pull request here: https://github.com/XOOPS/XoopsCore25/pull/1133 |
| Re: Module translation and special characters |
| by alain01 on 2021/12/1 6:39:18 Thank you Zyspec for this clear explanation |
| Re: Module translation and special characters |
| by zyspec on 2021/12/1 3:41:32 The HTML 'id' has historically only allowed [A-Za-z0-9-_:.], and the string must start with [A-Za-z] and not be empty. In other words a '/', space or accented chars, etc. are not valid for an id attribute. For HTML5 the only requirement is that it can't be empty and can't contain a space. Any code that uses a var for the HTML4 id should sanitize it first... Maybe something like: le="color: #000000"><?php $idAttrib = preg_replace('/^[A-Za-z]+([A-Za-z\d-_:.])*?$/', '_', $id); $idAttrib = !empty($idAttrib) ?? 'A' . (string)rand(1,32767); // create a random ID if it's currently empty For HTML5 just make sure that it's not empty and replace any spaces with an underscore. So something as simple as: le="color: #000000"><?php $idAttrib = str_replace(' ', '_', $id); $idAttrib = !empty($idAttrib) ?? 'A' . (string)rand(1,32767); // create a random ID if it's currently empty
|