From cfe54fedc7cec8a2b06a6579f5832caa588d1fd5 Mon Sep 17 00:00:00 2001 From: theli Date: Tue, 24 Oct 2006 05:07:34 +0000 Subject: [PATCH] *) Bugfix for resolveBackpath problem with tailing /.. *) Junit testclass for resolveBackpath testing git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@2850 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/net/URL.java | 6 ++--- test/de/anomic/net/URLTest.java | 40 +++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 3 deletions(-) create mode 100644 test/de/anomic/net/URLTest.java diff --git a/source/de/anomic/net/URL.java b/source/de/anomic/net/URL.java index d20ca0ccf..019eae042 100644 --- a/source/de/anomic/net/URL.java +++ b/source/de/anomic/net/URL.java @@ -161,7 +161,7 @@ public class URL { } // resolve '..' - private String resolveBackpath(String path) /* throws MalformedURLException */ { + String resolveBackpath(String path) /* throws MalformedURLException */ { /* original version by [MC] int p; while ((p = path.indexOf("/..")) >= 0) { @@ -174,7 +174,7 @@ public class URL { /* by [MT] */ if (path.length() == 0 || path.charAt(0) != '/') { path = "/" + path; } - Pattern pathPattern = Pattern.compile("(/[^/\\.]+/)[.]{2}(?=/)|/\\.(?=/)|/(?=/)"); + Pattern pathPattern = Pattern.compile("(/[^/]+(? " + resolvedURL); + + } + } + +}