escape referer

This commit is contained in:
zzz
2015-11-07 12:06:56 +00:00
parent c901010d96
commit f5bf4ec8ea
2 changed files with 5 additions and 3 deletions

View File

@ -14,6 +14,7 @@ import java.util.StringTokenizer;
import net.i2p.I2PAppContext;
import net.i2p.client.naming.NamingService;
import net.i2p.data.DataFormatException;
import net.i2p.data.DataHelper;
import net.i2p.data.Destination;
import net.i2p.i2ptunnel.I2PTunnelHTTPClient;
import net.i2p.util.FileUtil;
@ -165,7 +166,8 @@ public abstract class LocalHTTPServer {
Properties nsOptions = new Properties();
nsOptions.setProperty("list", book);
if (referer != null && referer.startsWith("http")) {
String from = "<a href=\"" + referer + "\">" + referer + "</a>";
String ref = DataHelper.escapeHTML(referer);
String from = "<a href=\"" + ref + "\">" + ref + "</a>";
nsOptions.setProperty("s", _t("Added via address helper from {0}", from));
} else {
nsOptions.setProperty("s", _t("Added via address helper"));

View File

@ -18,10 +18,10 @@ public class RouterVersion {
/** deprecated */
public final static String ID = "Monotone";
public final static String VERSION = CoreVersion.VERSION;
public final static long BUILD = 23;
public final static long BUILD = 24;
/** for example "-test" */
public final static String EXTRA = "";
public final static String EXTRA = "-rc";
public final static String FULL_VERSION = VERSION + "-" + BUILD + EXTRA;
public static void main(String args[]) {
System.out.println("I2P Router version: " + FULL_VERSION);