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

Build History - Doesn't return correct result if search data has upper case

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Minor Minor
    • core
    • None
    • Jenkins v2.27

      Steps:
      1. Create a build with HelloWorld in the build description
      2. On the build history widget, search with HelloWorld

      Expected Result:
      Should return the build with "HelloWorld" in the description

      Actual Result:
      Doesn't return the correct build. It only works if you enter "helloworld", all lower case.

      The issue is at core/src/main/java/jenkins/widgets/HistoryPageFilter.java, line 352

          private boolean fitsSearchString(Object data) {
              if (searchString == null) {
                  return true;
              }
      
              if (data != null) {
                  if (data instanceof Number) {
                      return data.toString().equals(searchString);
                  } else {
                      return data.toString().toLowerCase().contains(searchString);
                  }
              }
      
              return false;
          }
      

      Here, the data is converted to lowercase, but the searchString, which is "HelloWorld" in this particular case, is not coverted. As a result, it's not returning the correct result.

            godfath3r Panagiotis Galatsanos
            samsun387 Kevin Yu
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: