Bug #25350
closed
JS: TBE_EDITOR.rawurlencode produces wrong encoded strings in conjunction with UTF-8
Added by Frederic Gaus over 13 years ago.
Updated about 6 years ago.
Description
In conjunction with UTF-8, the js-function TBE_EDITOR.rawurlencode produces wrong encoded strings.
This leads to wrong encoded link-titles inside the browse-link dialogue. See screenshot attached.
(issue imported from #M17979)
Files
Yes, Ext.urlEncode is working nice. But with _v2 the maxlen-functionality is not working. You have to use output as the parameter. See v3.
This issue is also present in 4.5. I submitted the _v3 to gerrit, branch TYPO3_4-5. (Change I5a094088)
Should this also be commited to branch 4.4? If yes, how do I do this? I get:
git checkout -b issue_17979 origin/TYPO3_4-4 -> fatal: git checkout: branch issue_17979 already exists
(Sorry for the last two lines being off-topic)
please consilt the wiki. There are suggestions for branches:
rfc/master/M17979
rfc/4-5/M17979
rfc/4-4/M17979
You can't mix an issue in different branches.
committed to 4-4, 4-5 and trunk
I'm sorry, but I think the solution with Ext.urlEncode doesn't work.
From the ExtJs-manual: Takes an object and converts it to an encoded URL. e.g. Ext.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2".
In jsfunc.tbe_editor.js the code
Ext.urlEncode({'' : output});
returns
=mystring
if output=mystring.
Inserted in
<a onclick="
...P[fieldChangeFuncHash]=afadea6d036792882b4ff362f4393c30244fa4cf'+'&P[currentValue]='+TBE_EDITOR.rawurlencode(document.editform['data[tt_content][7][header_link]_hr'].value,200)+'&P[currentSelectedValues]='+TBE_EDITOR.curSelected('data[tt_content][7][header_link]_hr_list')
..." href="#"><img title="Link" alt="Link" src="sysext/t3skin/icons/gfx/link_popup.gif"></a>
(created in t3lib_tceforms::renderWizard) the finally called URL for the popup is
http://
.../typo3/browse_links.php?mode=wizard
...&P[currentValue]==mystring&P[currentSelectedValues]=
.
You see the == next to &P[currentValue]? The second = is part of the value and not necesarry. ;-)
I think, we have to possible solutions:
1. change all places in the TYPO3 core where TBE_EDITOR.rawurlencode is used to give Ext.urlEncode the correct object or
2. use encodeURIComponent(output) instead of Ext.urlEncode({'' : output}). encodeURIComponent is supported since IE5.5 and Netscape 6, so I don't think this would be a problem.
I would prever the second solution because with this solution we only have to change one little line. In my opinion using Ext.urlEncode is a breaking change.
What do you think?
- Status changed from Resolved to Closed
Also available in: Atom
PDF