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

Cannot configure job if the job name contains single quote

    Details

    • Type: Bug
    • Status: Reopened
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: core
    • Labels:
    • Environment:
      Ubuntu 11.10, Google Chrome 17.0.963.79

      Description

      Steps:

      1. Create a new job with name of "This won't work" (without double quotes)
      2. Go to the Configure page of the job you have just created

      The page keeps loading and seems to be broken

        Activity

        Hide
        kieranshaw Kieran Shaw added a comment -

        Appears to be here:

        "function registerValidator(e) {
        e.targetElement = findFollowingTR(e, "validation-error-area").firstChild.nextSibling;
        e.targetUrl = function()

        { return eval(this.getAttribute("checkUrl")); }

        ;"

        Where "this.getAttribute("checkUrl")" blows up because checkUrl contains something like: "'/checkDisplayName?displayName='encodeURIComponent(this.value)'&jobName='+encodeURIComponent('Job with single'quote')"

        Show
        kieranshaw Kieran Shaw added a comment - Appears to be here: "function registerValidator(e) { e.targetElement = findFollowingTR(e, "validation-error-area").firstChild.nextSibling; e.targetUrl = function() { return eval(this.getAttribute("checkUrl")); } ;" Where "this.getAttribute("checkUrl")" blows up because checkUrl contains something like: "'/checkDisplayName?displayName=' encodeURIComponent(this.value) '&jobName='+encodeURIComponent('Job with single'quote')"
        Hide
        proudgecko David Schamber added a comment -

        I have also experienced this issue in our Jenkins 1.478 on Windows Server 2003. I've confirmed the issue in IE, Firefox, Chrome, and Opera.

        Show
        proudgecko David Schamber added a comment - I have also experienced this issue in our Jenkins 1.478 on Windows Server 2003. I've confirmed the issue in IE, Firefox, Chrome, and Opera.
        Hide
        evernat evernat added a comment -

        I do not reproduce the issue using Jenkins 1.534 and Firefox or Chrome.
        Can we close this?

        Show
        evernat evernat added a comment - I do not reproduce the issue using Jenkins 1.534 and Firefox or Chrome. Can we close this?
        Hide
        danielbeck Daniel Beck added a comment -

        Cannot reproduce in 1.563. Browser console also shows numerous successful requests that seem related, e.g.

        http://localhost:8080/job/This%20won%27t%20work/descriptorByName/hudson.model.FreeStyleProject/checkAssignedLabelString?value=
        
        Show
        danielbeck Daniel Beck added a comment - Cannot reproduce in 1.563. Browser console also shows numerous successful requests that seem related, e.g. http: //localhost:8080/job/This%20won%27t%20work/descriptorByName/hudson.model.FreeStyleProject/checkAssignedLabelString?value=
        Hide
        harmia Juhana Harmanen added a comment - - edited

        Env: Jenkins 1.589 on Centos 6.5
        Browser: Chrome 38.0.2125.111 on Windows 8.1

        Problem: Job with a Maven project name containing 'something' in between. For example, Job with a name: CI build and Test 'master' branch

        When trying to re-configure the Job:

        • stalls on Loading (which doesn't actually prevent trying to edit, since not spanning over the whole view)
        • from the failing 404 GET requests one can identify that it appends / char before ' char on some requests. By executing these request directly without the appended / character before the ' char they do work.
        • One can swap through the HTML elements with tab and press to Save (wanted to fix the Job by renaming the project) which produces an Error: JSONObject["scm"] is not a JSONObject

        When trying to Delete Maven Project:

        • Uncaught SyntaxError: Unexpected identifier
        Show
        harmia Juhana Harmanen added a comment - - edited Env: Jenkins 1.589 on Centos 6.5 Browser: Chrome 38.0.2125.111 on Windows 8.1 Problem: Job with a Maven project name containing 'something' in between. For example, Job with a name: CI build and Test 'master' branch When trying to re-configure the Job: stalls on Loading (which doesn't actually prevent trying to edit, since not spanning over the whole view) from the failing 404 GET requests one can identify that it appends / char before ' char on some requests. By executing these request directly without the appended / character before the ' char they do work. One can swap through the HTML elements with tab and press to Save (wanted to fix the Job by renaming the project) which produces an Error: JSONObject ["scm"] is not a JSONObject When trying to Delete Maven Project: Uncaught SyntaxError: Unexpected identifier
        Hide
        danielbeck Daniel Beck added a comment -

        I can confirm much of what Juhana Harmanen describes on 1.586, except that it's backslashes instead of forward slashes. Most of the impact seems to stem from buggy escaping in the Javascript.

        Show
        danielbeck Daniel Beck added a comment - I can confirm much of what Juhana Harmanen describes on 1.586, except that it's backslashes instead of forward slashes. Most of the impact seems to stem from buggy escaping in the Javascript.

          People

          • Assignee:
            Unassigned
            Reporter:
            julienarchille jul
          • Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated: