Spring Mobile
  1. Spring Mobile
  2. MOBILE-68

Site path formatting is overwritten if it contains no slashes or only trailing slashes

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.1.0.M2
    • Fix Version/s: 1.1.0.M3
    • Component/s: device
    • Labels:
      None

      Description

      In AbstractSitePathUrlFactory, if a site path is configured with no slashes or only a trailing slash, formatPath incorrectly formats the path.

        Activity

        Hide
        Roy Clarkson added a comment -

        As noted in the forum post the formatPath method was modified to not overwrite any formatting.

        private String formatPath(String path) {
            String formattedPath = null;
            if (path != null) {
                formattedPath = (path.startsWith("/") ? path : "/" + path);
                formattedPath = (path.endsWith("/") ? formattedPath : formattedPath + "/");
            }
            return formattedPath;
        }
        
        Show
        Roy Clarkson added a comment - As noted in the forum post the formatPath method was modified to not overwrite any formatting. private String formatPath( String path) { String formattedPath = null ; if (path != null ) { formattedPath = (path.startsWith( "/" ) ? path : "/" + path); formattedPath = (path.endsWith( "/" ) ? formattedPath : formattedPath + "/" ); } return formattedPath; }

          People

          • Assignee:
            Roy Clarkson
            Reporter:
            Roy Clarkson
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: