Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-41930

manager.addShortText requires protection of characters '<' and '>'

    XMLWordPrintable

Details

    • groovy-postbuild-2.4.

    Description

      manager.addShortText(Text) displays an empty string if <Text> contains characters '<' or '>'.
      As a workaround, one can use: Text.replaceAll('<', '&lt').replaceAll('>', '&gt').

      The fix, on my opinion, is to add .replaceAll('<', '&lt').replaceAll('>', '&gt') inside the function addShortText itself.

      Probably, there are other characters which are not handled properly by the function. This is also desirable to be checked.

      Attachments

        Activity

          ikedam ikedam added a comment -

          Fixed in groovy-postbuild-2.4.

          ikedam ikedam added a comment - Fixed in groovy-postbuild-2.4.
          ikedam ikedam added a comment -

          Please try groovy-postbuild-2.4.

          ikedam ikedam added a comment - Please try groovy-postbuild-2.4.
          mathewa Adam Mathews added a comment - - edited

          Well, thanks a lot for this fix (sarcasm).  I can't embed a hyperlink for my test log <a href=someurl/index.htm>index.htm</a> via addShortText in the latest version.  It changes my < into & l t ;

          mathewa Adam Mathews added a comment - - edited Well, thanks a lot for this fix (sarcasm).  I can't embed a hyperlink for my test log <a href=someurl/index.htm>index.htm</a> via addShortText in the latest version.  It changes my < into & l t ;

          People

            alexander_samoylov Alexander Samoylov
            alexander_samoylov Alexander Samoylov
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: