*) yacyWiki: Images in a share on the same peer can be addressed by path and name only, no complete URL needed anymore. (As requested by theli in http://www.yacy-forum.de/viewtopic.php?t=809)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1215 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
low012 19 years ago
parent 8c594841a8
commit 80b3e85356

@ -53,6 +53,7 @@ import java.io.InputStreamReader;
import de.anomic.plasma.plasmaSwitchboard;
import de.anomic.server.serverCore;
import de.anomic.yacy.yacyCore;
public class wikiCode {
private String numListLevel="";
@ -347,7 +348,14 @@ public class wikiCode {
alt = " alt=\"" + kv + "\"";
}
result = result.substring(0, p0) + "<img src=\"" + kl + "\"" + align + alt + ">" + result.substring(p1 + 2);
// replace incomplete URLs and make them point to http://peerip:port/share/...
if (!((kl.startsWith("http://"))||(kl.startsWith("ftp://")))) {
final String ip = yacyCore.seedDB.mySeed.getAddress().trim();
final String port = sb.getConfig("port", "8080").trim();
kl = "http://" + ip + ":" + port + "/share/" + kl;
}
result = result.substring(0, p0) + "<img src=\"" + kl + "\"" + align.trim() + alt.trim() + ">" + result.substring(p1 + 2);
}
// end contrib [MN]

Loading…
Cancel
Save