https://issues.apache.org/bugzilla/show_bug.cgi?id=48098

           Summary: Cyrillyc(or any escaped with %) symbols inaccessible
                    via WebDav servlet (fix proposed)
           Product: Tomcat 6
           Version: 6.0.20
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: niko...@ukr.net


When I create, read, update, delete any file|folder with symbols that are
escaped (' or any Cyrillic char ) - I got an error.

I've fixed it for me, patching WebdavServlet.java method getRelativePath(). On
each return I unescape symbols:

protected String getRelativePath(HttpServletRequest request) {
        // Are we being processed by a RequestDispatcher.include()?
        if (request.getAttribute(Globals.INCLUDE_REQUEST_URI_ATTR) != null) {
            String result = (String) request
                    .getAttribute(Globals.INCLUDE_PATH_INFO_ATTR);
            if ((result == null) || (result.equals("")))
                result = "/";
            return unescape(result);
        }

        // No, extract the desired path directly from the request
        String result = request.getPathInfo();
        if ((result == null) || (result.equals(""))) {
            result = "/";
        }
        return unescape(result);
    }

This unescape() method is from official W3C site:
http://www.w3.org/International/unescape.java

Now it works excellent for me.

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to