|
|
@ -99,7 +99,6 @@ public final class plasmaHTCache {
|
|
|
|
|
|
|
|
|
|
|
|
this.log = new serverLog("HTCACHE");
|
|
|
|
this.log = new serverLog("HTCACHE");
|
|
|
|
this.cachePath = htCachePath;
|
|
|
|
this.cachePath = htCachePath;
|
|
|
|
this.maxCacheSize = maxCacheSize;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// reset old HTCache ?
|
|
|
|
// reset old HTCache ?
|
|
|
|
final String[] list = cachePath.list();
|
|
|
|
final String[] list = cachePath.list();
|
|
|
@ -534,6 +533,15 @@ public final class plasmaHTCache {
|
|
|
|
path = matcher.replaceAll("/!!/");
|
|
|
|
path = matcher.replaceAll("/!!/");
|
|
|
|
matcher.reset(path);
|
|
|
|
matcher.reset(path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (path != null) {
|
|
|
|
|
|
|
|
// yes this is not reversible, but that is not needed
|
|
|
|
|
|
|
|
searchPattern = Pattern.compile("(\"|\\\\|\\*|\\?|:|<|>|\\|)");
|
|
|
|
|
|
|
|
matcher = searchPattern.matcher(path);
|
|
|
|
|
|
|
|
while (matcher.find()) {
|
|
|
|
|
|
|
|
path = matcher.replaceAll("_");
|
|
|
|
|
|
|
|
matcher.reset(path);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
if (query != null) {
|
|
|
|
if (query != null) {
|
|
|
|
// yes this is not reversible, but that is not needed
|
|
|
|
// yes this is not reversible, but that is not needed
|
|
|
|
searchPattern = Pattern.compile("(\"|\\\\|\\*|\\?|/|:|<|>|\\|)");
|
|
|
|
searchPattern = Pattern.compile("(\"|\\\\|\\*|\\?|/|:|<|>|\\|)");
|
|
|
@ -664,6 +672,8 @@ public final class plasmaHTCache {
|
|
|
|
|
|
|
|
|
|
|
|
public final class Entry {
|
|
|
|
public final class Entry {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static final int MAXLENGTH = 255;
|
|
|
|
|
|
|
|
|
|
|
|
// the class objects
|
|
|
|
// the class objects
|
|
|
|
public Date initDate; // the date when the request happened; will be used as a key
|
|
|
|
public Date initDate; // the date when the request happened; will be used as a key
|
|
|
|
public int depth; // the depth of prefetching
|
|
|
|
public int depth; // the depth of prefetching
|
|
|
@ -801,7 +811,7 @@ public final class plasmaHTCache {
|
|
|
|
// we cannot match that here in the cache file path and therefore omit writing into the cache
|
|
|
|
// we cannot match that here in the cache file path and therefore omit writing into the cache
|
|
|
|
if (this.cacheFile.getParentFile().isFile() || this.cacheFile.isDirectory()) { return "path_ambiguous"; }
|
|
|
|
if (this.cacheFile.getParentFile().isFile() || this.cacheFile.isDirectory()) { return "path_ambiguous"; }
|
|
|
|
if (this.cacheFile.toString().indexOf("..") >= 0) { return "path_dangerous"; }
|
|
|
|
if (this.cacheFile.toString().indexOf("..") >= 0) { return "path_dangerous"; }
|
|
|
|
if (this.cacheFile.getAbsolutePath().length() > 250) { return "path too long"; }
|
|
|
|
if (this.cacheFile.getAbsolutePath().length() > MAXLENGTH) { return "path too long"; }
|
|
|
|
|
|
|
|
|
|
|
|
// -CGI access in request
|
|
|
|
// -CGI access in request
|
|
|
|
// CGI access makes the page very individual, and therefore not usable in caches
|
|
|
|
// CGI access makes the page very individual, and therefore not usable in caches
|
|
|
|