You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "David Rain (Created) (JIRA)" <ji...@apache.org> on 2012/03/13 14:45:38 UTC

[jira] [Created] (WICKET-4446) processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE

processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE
--------------------------------------------------------------------------------

                 Key: WICKET-4446
                 URL: https://issues.apache.org/jira/browse/WICKET-4446
             Project: Wicket
          Issue Type: Bug
          Components: wicket
    Affects Versions: 1.5.5, 1.5.4
         Environment: Windows 7 64-bit
Firefox 10 and IE 9
Wicket 1.5.4 and 1.5.5 tested
Jetty
            Reporter: David Rain


There's incosistency between org.apache.wicket.util.string.JavaScriptUtils and wicket-ajax.js
Even though the source is marked with comment

	 * Script open tag. If this tag is changed, also update Wicket.Head.Contributor.processScript()
	 * function from wicket-ajax.js

In JavaScriptUtils there are:
public final static String SCRIPT_CONTENT_PREFIX = "\n/*<![CDATA[*/\n";
public final static String SCRIPT_CONTENT_SUFFIX = "\n/*]]>*/\n";

in wicket-ajax.js (line 1742 in 1.5.5 version) there are:
// get rid of prefix and suffix, they are not eval-d correctly
text = text.replace(/^<!--\/\*--><!\[CDATA\[\/\*><!--\*\//, "");
text = text.replace(/\/\*-->]]>\*\/$/, "");

As you can see the sequences in java and javascript DO NOT MATCH! There are missing new lines in JS and there are extra HTML comments <!-- --> that aren't added by the Java code.
The result is, that these extra lines aren't removed and IE fails to eval such a javascript. I could fix this issue by editing the wicket-ajax.js like this:
text = text.replace(/^\n\/\*<!\[CDATA\[\*\/\n/, "");
text = text.replace(/\n\/\*]]>\*\/\n$/, "");

But we need it fixed officially, because we use gradle for Wicket dependency.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (WICKET-4446) processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE

Posted by "David Rain (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WICKET-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13228391#comment-13228391 ] 

David Rain commented on WICKET-4446:
------------------------------------

Note to the enviroment: FireFox is fine - it's javascipr engine can obviously handle such eval expression, but IE cannot (tested version 8 and 9)
                
> processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-4446
>                 URL: https://issues.apache.org/jira/browse/WICKET-4446
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.4, 1.5.5
>         Environment: Windows 7 64-bit
> Firefox 10 and IE 9
> Wicket 1.5.4 and 1.5.5 tested
> Jetty
>            Reporter: David Rain
>
> There's incosistency between org.apache.wicket.util.string.JavaScriptUtils and wicket-ajax.js
> Even though the source is marked with comment
> 	 * Script open tag. If this tag is changed, also update Wicket.Head.Contributor.processScript()
> 	 * function from wicket-ajax.js
> In JavaScriptUtils there are:
> public final static String SCRIPT_CONTENT_PREFIX = "\n/*<![CDATA[*/\n";
> public final static String SCRIPT_CONTENT_SUFFIX = "\n/*]]>*/\n";
> in wicket-ajax.js (line 1742 in 1.5.5 version) there are:
> // get rid of prefix and suffix, they are not eval-d correctly
> text = text.replace(/^<!--\/\*--><!\[CDATA\[\/\*><!--\*\//, "");
> text = text.replace(/\/\*-->]]>\*\/$/, "");
> As you can see the sequences in java and javascript DO NOT MATCH! There are missing new lines in JS and there are extra HTML comments <!-- --> that aren't added by the Java code.
> The result is, that these extra lines aren't removed and IE fails to eval such a javascript. I could fix this issue by editing the wicket-ajax.js like this:
> text = text.replace(/^\n\/\*<!\[CDATA\[\*\/\n/, "");
> text = text.replace(/\n\/\*]]>\*\/\n$/, "");
> But we need it fixed officially, because we use gradle for Wicket dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (WICKET-4446) processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE

Posted by "David Rain (Updated) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Rain updated WICKET-4446:
-------------------------------

    Environment: 
Windows 7 64-bit
Firefox 10 (is OK) and IE 8,9 (they fail)
Wicket 1.5.4 and 1.5.5 tested
Jetty

  was:
Windows 7 64-bit
Firefox 10 and IE 9
Wicket 1.5.4 and 1.5.5 tested
Jetty

    
> processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-4446
>                 URL: https://issues.apache.org/jira/browse/WICKET-4446
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.4, 1.5.5
>         Environment: Windows 7 64-bit
> Firefox 10 (is OK) and IE 8,9 (they fail)
> Wicket 1.5.4 and 1.5.5 tested
> Jetty
>            Reporter: David Rain
>
> There's incosistency between org.apache.wicket.util.string.JavaScriptUtils and wicket-ajax.js
> Even though the source is marked with comment
> 	 * Script open tag. If this tag is changed, also update Wicket.Head.Contributor.processScript()
> 	 * function from wicket-ajax.js
> In JavaScriptUtils there are:
> public final static String SCRIPT_CONTENT_PREFIX = "\n/*<![CDATA[*/\n";
> public final static String SCRIPT_CONTENT_SUFFIX = "\n/*]]>*/\n";
> in wicket-ajax.js (line 1742 in 1.5.5 version) there are:
> // get rid of prefix and suffix, they are not eval-d correctly
> text = text.replace(/^<!--\/\*--><!\[CDATA\[\/\*><!--\*\//, "");
> text = text.replace(/\/\*-->]]>\*\/$/, "");
> As you can see the sequences in java and javascript DO NOT MATCH! There are missing new lines in JS and there are extra HTML comments <!-- --> that aren't added by the Java code.
> The result is, that these extra lines aren't removed and IE fails to eval such a javascript. I could fix this issue by editing the wicket-ajax.js like this:
> text = text.replace(/^\n\/\*<!\[CDATA\[\*\/\n/, "");
> text = text.replace(/\n\/\*]]>\*\/\n$/, "");
> But we need it fixed officially, because we use gradle for Wicket dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Resolved] (WICKET-4446) processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE

Posted by "Martin Grigorov (Resolved) (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WICKET-4446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Grigorov resolved WICKET-4446.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: 6.0.0
                   1.5.6
         Assignee: Martin Grigorov
    
> processScript in Wicket.Head.Contributor doesn't remove CDATA - eval fails in IE
> --------------------------------------------------------------------------------
>
>                 Key: WICKET-4446
>                 URL: https://issues.apache.org/jira/browse/WICKET-4446
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket
>    Affects Versions: 1.5.4, 1.5.5
>         Environment: Windows 7 64-bit
> Firefox 10 (is OK) and IE 8,9 (they fail)
> Wicket 1.5.4 and 1.5.5 tested
> Jetty
>            Reporter: David Rain
>            Assignee: Martin Grigorov
>             Fix For: 1.5.6, 6.0.0
>
>
> There's incosistency between org.apache.wicket.util.string.JavaScriptUtils and wicket-ajax.js
> Even though the source is marked with comment
> 	 * Script open tag. If this tag is changed, also update Wicket.Head.Contributor.processScript()
> 	 * function from wicket-ajax.js
> In JavaScriptUtils there are:
> public final static String SCRIPT_CONTENT_PREFIX = "\n/*<![CDATA[*/\n";
> public final static String SCRIPT_CONTENT_SUFFIX = "\n/*]]>*/\n";
> in wicket-ajax.js (line 1742 in 1.5.5 version) there are:
> // get rid of prefix and suffix, they are not eval-d correctly
> text = text.replace(/^<!--\/\*--><!\[CDATA\[\/\*><!--\*\//, "");
> text = text.replace(/\/\*-->]]>\*\/$/, "");
> As you can see the sequences in java and javascript DO NOT MATCH! There are missing new lines in JS and there are extra HTML comments <!-- --> that aren't added by the Java code.
> The result is, that these extra lines aren't removed and IE fails to eval such a javascript. I could fix this issue by editing the wicket-ajax.js like this:
> text = text.replace(/^\n\/\*<!\[CDATA\[\*\/\n/, "");
> text = text.replace(/\n\/\*]]>\*\/\n$/, "");
> But we need it fixed officially, because we use gradle for Wicket dependency.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira