jericho 2003/01/24 05:45:49
Modified: httpclient/src/java/org/apache/commons/httpclient URI.java
Log:
Fix a bug not to validate the escaped rel_path correctly...
Reported by Armando_Anton <[EMAIL PROTECTED]>
Thank you for reviewing.
Revision Changes Path
1.23 +7 -6
jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java
Index: URI.java
===================================================================
RCS file:
/home/cvs/jakarta-commons/httpclient/src/java/org/apache/commons/httpclient/URI.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- URI.java 23 Jan 2003 22:47:48 -0000 1.22
+++ URI.java 24 Jan 2003 13:45:49 -0000 1.23
@@ -2693,8 +2693,9 @@
int at = indexFirstOf(escapedPath, '/');
if (at == 0)
throw new URIException(URIException.PARSING, "incorrect path");
- if (at > 0 && !validate(escapedPath, 0, at, rel_segment) ||
- at < 0 && !validate(escapedPath, 0, -1, abs_path))
+ if (at > 0 && !validate(escapedPath, 0, at - 1, rel_segment) &&
+ !validate(escapedPath, at, -1, abs_path) ||
+ at < 0 && !validate(escapedPath, 0, -1, rel_segment))
throw new URIException(URIException.ESCAPING,
"escaped relative path not valid");
_path = escapedPath;
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>