You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by "Andrea Del Bene (Jira)" <ji...@apache.org> on 2023/02/24 16:42:00 UTC

[jira] [Assigned] (WICKET-7022) JavaScriptStripper fails to detect regular expression correctly

     [ https://issues.apache.org/jira/browse/WICKET-7022?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrea Del Bene reassigned WICKET-7022:
---------------------------------------

    Assignee: Andrea Del Bene

> JavaScriptStripper fails to detect regular expression correctly
> ---------------------------------------------------------------
>
>                 Key: WICKET-7022
>                 URL: https://issues.apache.org/jira/browse/WICKET-7022
>             Project: Wicket
>          Issue Type: Bug
>          Components: wicket-core
>    Affects Versions: 9.12.0
>            Reporter: Martin Hesse
>            Assignee: Andrea Del Bene
>            Priority: Major
>         Attachments: summernote-bs5.js, summernote-bs5.min.js
>
>
> The {{JavaScriptStripper}} fails to accurately detect regular expressions in some cases.
> In the example below it fails to switch into the {{REG_EXP}} state at '{{{}return/[{}}}', and will then switch to {{LINE_COMMENT}} state when parsing '{{{}//{}}}', which will then lead to the entire rest of the JavaScript code to be cut off, making the code unparseable by the client.
> {{return/[-a-zA-Z0-9@:%._\+~#=]\{2,256}\.[a-z]\{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)/gi.test(t)}};}}
> An example of a webjar containing javascript, that will trigger the bug can be found here: [https://search.maven.org/artifact/org.webjars.npm/summernote/0.8.20/jar] - also see attached JS files below.
> Current workaround is to disable compression:
> getResourceSettings().setJavaScriptCompressor(null);



--
This message was sent by Atlassian Jira
(v8.20.10#820010)