[Typo3-dev] RFC: Bug #277: utf-8 + JSMENU/feAdminLib
Ernesto Baschny [cron IT]
ernst at cron-it.de
Fri Oct 21 10:18:25 CEST 2005
Bernhard Kraft schrieb am 21.10.2005 04:41:
>> 1) we can just strip this method from the tslib_cObj patch
>> 2) merge the part that updates the "updateForm" calls to call
>> LANG->JScharCode with what my patch in #1472 does for the alert dialogs
>> 3) apply to CVS :)
> If you have read the thread completly you would know that those
> JScharCode are completly unnecessary.
>
> Tell me: do you write ü or similar into your HTML any more ? or do
> you directly input the meant characters ?
>
> Or does T3 output ever "ü" as ü .... no ... simply because it is
> not necessary. And the same is true for Javascript
> strings. Only the delimiter " or ' needs to get quoted with a \
Bernhard, you are right! And at 4:41 in the morning you can still think
about those things? :)
I've updated my patch, which now reads:
- $cf1="if
(confirm(unescape('".t3lib_div::rawurlencodeJS($confirm)."'))){";
+ $cf1="if
(confirm('".htmlspecialchars(addcslashes($confirm,"'"))."')){";
Tested it and it works great. Also nicer to read in the source-code.
Updated my bug report with the new patch in
http://bugs.typo3.org/view.php?id=1472
Note, this just refers to the alert() dialog in EDITPANELS, other places
refered to in http://bugs.typo3.org/view.php?id=277 are unaffected.
Speaking of which, I've just looked at your utf8_JS.patch, which is the
solution you propose. I see that you also change the confirm() dialog in
the EDITPANELS like I do in my patch. Well, I guess that's not enough,
because the string $confirm is being get through
t3lib_tsfebeuserauth::extGetLL, which will translate all chars to
UTF8-entites (utf8_to_entities). So you end up with lots of
"Сл..." garbage in those alerts (try setting your language
to russian). This is what my patch fixes: it adds an option to extGetLL
which will disable the entity-encoding: then you can output $confirm
directly (through your addcslashes and htmlspecialchars trick).
So to sum up, I think the best solution is:
Patch editpanels-javascript-dialog-charset-fix.patch from:
http://bugs.typo3.org/view.php?id=1472
Patch utf8_JS.patch from:
http://bugs.typo3.org/view.php?id=277
The only conflict is the above mentioned $confirm outputting. I've added
a htmlspecialchars around it, while Bernhard didn't. Isn't that needed,
Bernhard, since we are in a (X)HTML-attribute?
Cheers,
Ernesto
More information about the TYPO3-dev
mailing list