Bug #14367
closed
class.tslib_content.php function getUpdateJS produce JS error messages
Added by Bernd Hanisch about 20 years ago.
Updated over 16 years ago.
Category:
Content Rendering
Description
this function forget to add a ";" after each generated javascript line so that the IE popup with a error message if you visit a page. you can reproduce this on a direct mail subscriptions page. i fixed it by change this lines:
5679: updateForm('".$formName."','".$arrPrefix."[".$fKey."][]',unescape('".rawurlencode($Nvalue)."'));";
and
5684: updateForm('".$formName."','".$arrPrefix."[".$fKey."]',unescape('".rawurlencode($value)."'));";
(issue imported from #M434)
Files
This is a bug.
I cannot attach this as a file. So it comes here. This is neeed for sr_feuser_register, too.
see http://bugs.typo3.org/view.php?id=3986
--------------------
function getUpdateJS($dataArray, $formName, $arrPrefix, $fieldList) {
$JSPart='';
$updateValues=t3lib_div::trimExplode(',',$fieldList);
while(list(,$fKey)=each($updateValues)) {
$value = $dataArray[$fKey];
if (is_array($value)) {
reset($value);
while(list(,$Nvalue)=each($value)) {
$JSPart.="
updateForm('".$formName."','".$arrPrefix."[".$fKey."][]',".t3lib_div::quoteJSvalue($Nvalue, true).");";
}
} else {
$JSPart.="
updateForm('".$formName."','".$arrPrefix."[".$fKey."]',".t3lib_div::quoteJSvalue($value, true).");";
}
}
$JSPart='<script type="text/javascript">
/*<![CDATA[*/ '.$JSPart.'
/*]]>*/
</script>
';
Wow... This is an old one.
Because the problem, still exists. I've added a patch for 4.2.
Greets,
Thomas
Commited to trunk and branch 4.1
Also available in: Atom
PDF