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

Check the Id value (as filename) when creating a script

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • scriptler-plugin
    • None
    • scriptler:2.10

      On the script creation page, the value of the Id is not verified. If you put something like "<" or any other character that are not allowed as filename, you receive an exception stack.

      Two solutions:

      • either convert the characters that are not valid to "_" (better solution from UX PoV)
      • or warn the users and ask another Id.

      Take care of the filename that are not valid under Windows like "con", cf. SO question.

      The method fixFileName starts the work (with spaces) but is not exhaustive.

          [JENKINS-48688] Check the Id value (as filename) when creating a script

          Wadeck Follonier created issue -
          Wadeck Follonier made changes -
          Description Original: On the script creation page, the value of the Id is not verified. If you put something like "<" or any other character that are not allowed as filename, you receive an exception stack.

          Two solutions:
          - either convert the characters that are not valid to "_" (better solution from UX PoV)
          - or warn the users and ask another Id.

          Take care of the filename that are not valid under Windows like "con", cf. [SO question|https://stackoverflow.com/questions/6730009/validate-a-file-name-on-windows].
          New: On the script creation page, the value of the Id is not verified. If you put something like "<" or any other character that are not allowed as filename, you receive an exception stack.

          Two solutions:
           - either convert the characters that are not valid to "_" (better solution from UX PoV)
           - or warn the users and ask another Id.

          Take care of the filename that are not valid under Windows like "con", cf. [SO question|https://stackoverflow.com/questions/6730009/validate-a-file-name-on-windows].

          The method {{fixFileName}} starts the work (with spaces) but is not exhaustive. One of the "easy" way to avoid the exception is to put a try/catch around {{Writer writer = new FileWriter(newScriptFile);}} line.
          Wadeck Follonier made changes -
          Description Original: On the script creation page, the value of the Id is not verified. If you put something like "<" or any other character that are not allowed as filename, you receive an exception stack.

          Two solutions:
           - either convert the characters that are not valid to "_" (better solution from UX PoV)
           - or warn the users and ask another Id.

          Take care of the filename that are not valid under Windows like "con", cf. [SO question|https://stackoverflow.com/questions/6730009/validate-a-file-name-on-windows].

          The method {{fixFileName}} starts the work (with spaces) but is not exhaustive. One of the "easy" way to avoid the exception is to put a try/catch around {{Writer writer = new FileWriter(newScriptFile);}} line.
          New: On the script creation page, the value of the Id is not verified. If you put something like "<" or any other character that are not allowed as filename, you receive an exception stack.

          Two solutions:
           - either convert the characters that are not valid to "_" (better solution from UX PoV)
           - or warn the users and ask another Id.

          Take care of the filename that are not valid under Windows like "con", cf. [SO question|https://stackoverflow.com/questions/6730009/validate-a-file-name-on-windows].

          The method {{fixFileName}} starts the work (with spaces) but is not exhaustive.

            domi Dominik Bartholdi
            wfollonier Wadeck Follonier
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: