From 139ba4e0c8ca78044680c8baaa403a5ee7c0e8f4 Mon Sep 17 00:00:00 2001 From: borg-0300 Date: Wed, 1 Feb 2006 19:07:49 +0000 Subject: [PATCH] Bugfix for getCachePath(URL url) git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1510 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/plasma/plasmaHTCache.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/de/anomic/plasma/plasmaHTCache.java b/source/de/anomic/plasma/plasmaHTCache.java index 14d8e1117..37f06ffd7 100644 --- a/source/de/anomic/plasma/plasmaHTCache.java +++ b/source/de/anomic/plasma/plasmaHTCache.java @@ -528,14 +528,21 @@ public final class plasmaHTCache { if (!path.startsWith("/")) { path = "/" + path; } if (path.endsWith("/") && query == null) { path = path + "ndx"; } - Pattern pathPattern = Pattern.compile("/\\.\\./"); - Matcher matcher = pathPattern.matcher(path); + Pattern searchPattern = Pattern.compile("/\\.\\./"); + Matcher matcher = searchPattern.matcher(path); while (matcher.find()) { path = matcher.replaceAll("/!!/"); matcher.reset(path); } if (query != null) { - path = path.concat("_").concat(query.replaceAll("[\"\\/:*?<>|]", "_")); // yes this is not reversible, but that is not needed + // yes this is not reversible, but that is not needed + searchPattern = Pattern.compile("(\"|\\\\|\\*|\\?|/|:|<|>|\\|)"); + matcher = searchPattern.matcher(query); + while (matcher.find()) { + query = matcher.replaceAll("_"); + matcher.reset(query); + } + path = path.concat("_").concat(query); } // only set NO default ports int port = url.getPort();