Author: toad
Date: 2009-01-10 20:30:03 +0000 (Sat, 10 Jan 2009)
New Revision: 25003
Modified:
trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
Log:
Fix fixing non-absolute links
Modified: trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
2009-01-10 20:29:25 UTC (rev 25002)
+++ trunk/freenet/src/freenet/clients/http/LocalFileInsertToadlet.java
2009-01-10 20:30:03 UTC (rev 25003)
@@ -36,6 +36,8 @@
this.core = core;
}
+ static final String URL = "/files/";
+
/**
* @see freenet.clients.http.Toadlet#handleGet(java.net.URI,
* freenet.clients.http.ToadletContext)
@@ -107,7 +109,7 @@
HTMLNode rootRow = listingTable.addChild("tr");
rootRow.addChild("td");
HTMLNode rootLinkCellNode =
rootRow.addChild("td");
- rootLinkCellNode.addChild("a", "href",
container.fixLink("?path=" +
URLEncoder.encode(currentRoot.getCanonicalPath(),false)+extra),
currentRoot.getCanonicalPath());
+ rootLinkCellNode.addChild("a", "href",
container.fixLink(URL+"?path=" +
URLEncoder.encode(currentRoot.getCanonicalPath(),false)+extra),
currentRoot.getCanonicalPath());
rootRow.addChild("td");
}
/* add back link */
@@ -115,7 +117,7 @@
HTMLNode backlinkRow =
listingTable.addChild("tr");
backlinkRow.addChild("td");
HTMLNode backlinkCellNode =
backlinkRow.addChild("td");
- backlinkCellNode.addChild("a", "href",
container.fixLink("?path=" +
URLEncoder.encode(currentPath.getParent(),false)+extra), "..");
+ backlinkCellNode.addChild("a", "href",
container.fixLink(URL+"?path=" +
URLEncoder.encode(currentPath.getParent(),false)+extra), "..");
backlinkRow.addChild("td");
}
for (int fileIndex = 0, fileCount = files.length;
fileIndex < fileCount; fileIndex++) {
@@ -130,7 +132,7 @@
if(furi != null)
formNode.addChild("input", new String[] { "type", "name", "value" }, new
String[] { "hidden", "key", furi.toASCIIString() });
HTMLNode directoryCellNode =
fileRow.addChild("td");
- directoryCellNode.addChild("a",
"href", container.fixLink("?path=" +
URLEncoder.encode(currentFile.getAbsolutePath(),false)+extra),
currentFile.getName());
+ directoryCellNode.addChild("a",
"href", container.fixLink(URL+"?path=" +
URLEncoder.encode(currentFile.getAbsolutePath(),false)+extra),
currentFile.getName());
} else {
fileRow.addChild("td");
fileRow.addChild("td", "class",
"unreadable-file", currentFile.getName());
_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs