菜单

TBE_EDITOR.rawurlencode erroneously adds “=” in wizards

2012年01月17日 - typo3

If you use a wizard for a colorpicker or a link in TYPO3 4.4.8 and 4.5.3 (haven’t tested with older versions) and click on the wizard button, the current value of the field is retrieved in the window.open() function using

TBE_EDITOR.rawurlencode(document.editform[‘data[pages][1][tx_testextension_color]_hr’].value,200)
TBE_EDITOR.rawurlencode(document.editform[‘data[pages][1][tx_testextension_internet]_hr’].value,200)
This returns a wrong value, because TBE_EDITOR.rawurlencode always adds a “=” in front:
– If the value is empty, “=” will be returned, resulting in a default value “http://=” in the link wizard.
– If a value is set in the color picker, e.g. “#333666”, the result of TBE_EDITOR.rawurlencode will be “=#333666” in the colorpicker wizard.

	rawurlencode: function(str,maxlen) {
		var output = str;
		if (maxlen)	output = output.substr(0,200);
		// output = Ext.urlEncode({'' : output});
		output = encodeURIComponent(output);
		return output;
	},

发表评论

电子邮件地址不会被公开。 必填项已用*标注