Project

General

Profile

Actions

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.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2011-03-17
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.4
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

TBE_EDITOR.rawurlencode Problem.png (378 KB) TBE_EDITOR.rawurlencode Problem.png Administrator Admin, 2011-03-17 14:17
17979.patch (2.33 KB) 17979.patch Administrator Admin, 2011-03-17 14:27
17979_v2.diff (669 Bytes) 17979_v2.diff Administrator Admin, 2011-03-18 22:50
17979_v3.patch (760 Bytes) 17979_v3.patch Administrator Admin, 2011-03-21 09:45

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #27028: Linkhandler add a "="-Sign to all existing and new linksClosed2011-05-25

Actions
Actions #1

Updated by Frederic Gaus over 13 years ago

The Problem is caused by the call of the js-function "escape" with produces wrong results in conjunction with UTF-8.

The attached patch uses a code snipped from http://www.webtoolkit.info/javascript-url-decode-encode.html. With this patch applied the problem is fixed.

Actions #2

Updated by Helmut Hummel over 13 years ago

Try v2 which uses ExtJs

Actions #3

Updated by Frederic Gaus over 13 years ago

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.

Actions #4

Updated by Frederic Gaus over 13 years ago

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)

Actions #5

Updated by Steffen Kamper over 13 years ago

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.

Actions #6

Updated by Frederic Gaus over 13 years ago

Thanks for your feedback, steffen. I read the following:

http://wiki.typo3.org/Contribution_Walkthrough_with_CommandLine

The codesamples are a bit missleading then. I will provide new commits with better branch-names

Actions #7

Updated by Steffen Kamper over 13 years ago

committed to 4-4, 4-5 and trunk

Actions #8

Updated by Marco Huber over 13 years ago

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'+'&amp;P[currentValue]='+TBE_EDITOR.rawurlencode(document.editform['data[tt_content][7][header_link]_hr'].value,200)+'&amp;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?

Actions #9

Updated by Marco Huber over 13 years ago

there is already an issue: http://forge.typo3.org/issues/27028
and I created a patch for this: https://review.typo3.org/#change,2509

Actions #10

Updated by Benni Mack about 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF