Project

General

Profile

Actions

Bug #62062

closed

Bugfix of #55457 creates JavaScript errors in frontend of TYPO3 4.5.36

Added by Heinz Schilling over 9 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-10-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

After the update from 4.5.35 to 4.5.36 some JavaScript errors destroy powermail and imagecycle JavaScripts. When I undo Revision b2597fd4 everything works fine.

With config.spamProtectEmailAddresses = 1 the JavaScript errors can be shown in inline JavaScript in the frontend.

Tested with Safari 7.1 and Firefox 32.0.3 on OS X.

Actions #1

Updated by Georg Ringer over 9 years ago

  • Is Regression changed from No to Yes
Actions #2

Updated by Markus Klein over 9 years ago

The referenced commit only removes HTML comments inside the script tags. What is the JS error shown?

Actions #3

Updated by Heinz Schilling over 9 years ago

SyntaxError: Unexpected token ')'. Expected ';' after var declaration.

TYPO3 4.5.36

function decryptString(enc,offset){
    var dec="";
    var len=enc.length;
    for(var i=0;i<len;i++){
        var n="enc.charCodeAt(i);
        if(n">=0x2B&&n<=0x3A){
            dec+=decryptCharcode(n,0x2B,0x3A,offset);
        }else if(n>=0x40&&n<=0x5A){
            dec+=decryptCharcode(n,0x40,0x5A,offset);
        }else if(n>=0x61&&n<=0x7A){
            dec+=decryptCharcode(n,0x61,0x7A,offset);
        }else{
            dec+=enc.charAt(i);
        }
    }
    return dec;
}

TYPO3 4.5.35

function decryptString(enc,offset){
    var dec="";
    var len=enc.length;
    for(var i=0;i<len;i++){
        var n=enc.charCodeAt(i);
        if(n>=0x2B&&n<=0x3A){
            dec+=decryptCharcode(n,0x2B,0x3A,offset);
        }else if(n>=0x40&&n<=0x5A){
            dec+=decryptCharcode(n,0x40,0x5A,offset);
        }else if(n>=0x61&&n<=0x7A){
            dec+=decryptCharcode(n,0x61,0x7A,offset);
        }else{
            dec+=enc.charAt(i);
        }
    }
    return dec;
}

In TYPO3 4.5.36 there are now some strange " in the JavaScript code. For Example in line

        var n="enc.charCodeAt(i);

or in line
        if(n">=0x2B&&n<=0x3A){

Hope this helps.

Actions #4

Updated by Markus Klein over 9 years ago

  • Is Regression changed from Yes to No

Alright, this is indeed not good, but IMO not related to #55457.

Actions #5

Updated by Markus Klein over 9 years ago

  • Status changed from New to Needs Feedback

I verified this with a live site from us, which is on latest 4.5 branch. Can't reproduce the issue there.

What extensions do you use? Any one modifying the HTML/JS output?

Actions #6

Updated by Heinz Schilling over 9 years ago

I made a fresh 4.5.36 installation with introduction package and the following options:

config.spamProtectEmailAddresses = 1
config.spamProtectEmailAddresses_atSubst = (at)
config.removeDefaultJS = 0

Can't reproduce the issue there. I have to look which extension fails.

Actions #7

Updated by Markus Klein over 9 years ago

  • Status changed from Needs Feedback to Closed
Actions #8

Updated by Björn Heinermann over 9 years ago

Hi all,

the ts configuration config.xhtml_cleaning = all destroy the javascript code. If I comment out the parameter, everything works fine.

Best wishes
Björn

Actions #9

Updated by Heinz Schilling over 9 years ago

Can confirm information from Björn. Thank you.

Actions #10

Updated by Pascal Naujoks over 9 years ago

Can confirm Björns solution in 4.5.38. Thanks!

Actions

Also available in: Atom PDF