jenkinsci / extended-choice-parameter-plugin

Jenkins extended-choice-parameter plugin
https://plugins.jenkins.io/extended-choice-parameter/
MIT License
74 stars 98 forks source link

Logical operators are converted to HTML chars in javascript #97

Open MichalKarfiol opened 1 year ago

MichalKarfiol commented 1 year ago

Jenkins and plugins versions report

Environment Jenkins: 2.401.2 OS: Windows Server 2019 - 10.0 Java: 11.0.19 - Azul Systems, Inc. (OpenJDK 64-Bit Server VM) Plugin: Name: extended-choice-parameter Version: 373.v1a_ecea_fdf2a_a_

What Operating System are you using (both controller, and any agents involved in the problem)?

Windows (Controller) Windows (Agent)

Reproduction steps

  1. Create a new 'Extended Choice Parameter'
  2. Name 'Test'
  3. Select 'JSON Parameter Type'
  4. Select 'JSON Parameter Config Javascript'
  5. Put simple IF statement with alert message if (0 < 5) alert ('Test')
  6. Save configuration
  7. Click on Build with Parameters
  8. (!) Syntax error caught in debug mode in web browser (see the attached screenshot below)
ECP_Error

Expected Results

It pops up an alert message when go on 'Build with Parameters' page

Actual Results

No popup with an alert message appears because of syntax error in used javascript when go on 'Build with Parameters' page

Anything else?

It worked fine in the previous version extended-choice-parameter:359.v35dcfdd0c20d Currently when logical operators like <, >, &&, || are used in javascript they are converted to HTML chars