Bug #18897
closedUmlauts get broken in shortcut menu while renaming the shortcut
0%
Description
When you edit an item in the new shortcut menu and use special chars in the name (e.g. äöü), these umlauts get brocken (output is like äöü)
How to reproduce:
- create a new shortcut e.g. in Page-Modul by clicking the shortcut-icon at the bottom of the right frame
- open the shortcut dropdown menu at the top
- edit the new item
- use any special char in the name (e.g. ä ö ü)
- click OK to save
- the the brocken umlauts
Whats the reson?
The javascript of the menu uses prototypes "Ajax.Request" to send the new name to the Server.
"Ajax.Request" uses "encodeURIcomponent" to urlencode the Strings in the form to make them safe to send by GET or POST
Unfortunately "encodeURIcomponent" ALWAY uses UTF-8 as encoding and does not care which charset is used on the current page.
So the server/php-script recieves an UTF-8 encoded string which is expected to be ISO-8859-1 (which is the defualt for the backend).
The script saves the utf-8-string to the database as it is, but later it is read and delivered as an ISO-8859-string
THIS ALSO HAPPENS IN
- t3editor (here i found a solution: see #8264)
- web>access (reported by susanne moog in #8578)
- and everywhere where teh new ajax.php/typo3ajax is used to RECIEVE data via Ajax.Request
How to solve?
In my patch for #8264 i check the used charset in the incoming Ajaxrequest and compare it to the charset used in the backend. If needed all POST-data would be converted.
Should this be handeled by the ajax.php for all requests?
If yes, i can make a patch for this
IMHO this should be fixed for 4.2.1
(issue imported from #M8591)
Files