Uploaded image for project: 'Apache Roller'
  1. Apache Roller
  2. ROL-2066

Comment URLs using https:// not saving properly in Gaurav theme

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: 5.1.1
    • Fix Version/s: 5.1.2
    • Component/s: Themes and Macros
    • Labels:
      None

      Description

      entry.vm in Gaurav theme has a convenient JavaScript method which named fixURL(). it's binded in the onsubmit event handler in comment form and it prepends http:// to commentor's URL if one has no scheme in the URL. for example it converts the URL which a commentor entered as follows:

      www.example.com => http://www.example.com
      

      The code of the method is following:

      function fixURL(theForm) {
          if (theForm.url.value != "" &&
              theForm.url.value.indexOf("http://") == -1) { //prepend http://
              theForm.url.value = "http://"+theForm.url.value;
          }
          saveUserInformation(theForm);
      }
      

      It works well for most cases, but not for a URL which begins with https:// or some other schemes (e.g. ftp://). it goes wrong with such URL as follows:

      https://www.example.com => http://https://www.example.com
      

      I think current implementation of fixURL() which is simply searching "http://" is not enough.

      1. ROL-2066.patch
        0.7 kB
        Kohei Nozaki
      2. Screen Shot 2015-02-28 at 12.52.03.png
        97 kB
        Kohei Nozaki
      3. Screen Shot 2015-02-28 at 12.52.17.png
        99 kB
        Kohei Nozaki

        Activity

        Hide
        xkylex Kohei Nozaki added a comment -

        Commentors can't use https:// URL

        Show
        xkylex Kohei Nozaki added a comment - Commentors can't use https:// URL
        Hide
        xkylex Kohei Nozaki added a comment -

        Fixed patch (sorry, original one produces syntax error so I deleted it)

        Show
        xkylex Kohei Nozaki added a comment - Fixed patch (sorry, original one produces syntax error so I deleted it)
        Hide
        djohnson David Johnson added a comment -

        Another nice one. Thanks again Kohei!

        Author: snoopdave
        Date: Sun Mar 1 18:09:45 2015
        New Revision: 1663142

        URL: http://svn.apache.org/r1663142
        Log:
        Fix for ROL-2066 Commentors can't leave a comment using URL begins with https:// in Gaurav theme

        Modified:
        roller/trunk/app/src/main/webapp/themes/gaurav/entry.vm

        Show
        djohnson David Johnson added a comment - Another nice one. Thanks again Kohei! Author: snoopdave Date: Sun Mar 1 18:09:45 2015 New Revision: 1663142 URL: http://svn.apache.org/r1663142 Log: Fix for ROL-2066 Commentors can't leave a comment using URL begins with https:// in Gaurav theme Modified: roller/trunk/app/src/main/webapp/themes/gaurav/entry.vm
        Hide
        djohnson David Johnson added a comment -

        5.1.2 released

        Show
        djohnson David Johnson added a comment - 5.1.2 released

          People

          • Assignee:
            djohnson David Johnson
            Reporter:
            xkylex Kohei Nozaki
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development