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

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

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 5.1.1
    • 5.1.2
    • Themes and Macros
    • 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.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

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

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment