Bug 11160 - URIUtil.unescape does not work on last escaped character
Summary: URIUtil.unescape does not work on last escaped character
Status: RESOLVED INVALID
Alias: None
Product: Slide
Classification: Unclassified
Component: WebDAV client (show other bugs)
Version: Nightly
Hardware: All All
: P3 normal (vote)
Target Milestone: ---
Assignee: Slide Developer List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-07-25 08:54 UTC by Rob Owen
Modified: 2004-11-16 19:05 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rob Owen 2002-07-25 08:54:20 UTC
org.apache.util.URIUtil.unescape does not unescape the last escaped character 
as it fails the length test (eg. Test%24%24 becomes Test$%24). The fix is in 
the patch below.

--- URIUtil.cvs.java	2002-07-24 20:37:41.000000000 +0100
+++ URIUtil.java	2002-07-24 20:37:52.000000000 +0100
@@ -340,7 +340,7 @@
         int ox = 0;
         while (ix < len) {
             byte b = bytes[ix++];     // Get byte to test
-            if ((b == '%') && (ix+2 < len)) {
+            if ((b == '%') && (ix+2 <= len)) {
                 b = (byte) ((convertHexDigit(bytes[ix++]) << 4)
                             + convertHexDigit(bytes[ix++]));
             }
Comment 1 Oliver Zeigermann 2003-12-18 13:04:29 UTC
Seems to be outdated. Please check and resubmit if not :)