forked from I2P_Developers/i2p.i2p
console escape fixes and cleanups
This commit is contained in:
@ -10,17 +10,13 @@ import net.i2p.util.Log;
|
||||
|
||||
/**
|
||||
* Handler to deal with form submissions from the tunnel config form and act
|
||||
* upon the values. Holy crap, this is UUUUGLY
|
||||
* upon the values.
|
||||
*
|
||||
*/
|
||||
public class ConfigTunnelsHandler extends FormHandler {
|
||||
private Map _settings;
|
||||
|
||||
private boolean _shouldSave;
|
||||
|
||||
public ConfigTunnelsHandler() {
|
||||
_shouldSave = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processForm() {
|
||||
if (_shouldSave) {
|
||||
@ -35,8 +31,6 @@ public class ConfigTunnelsHandler extends FormHandler {
|
||||
_shouldSave = true;
|
||||
}
|
||||
|
||||
public void setSettings(Map settings) { _settings = new HashMap(settings); }
|
||||
|
||||
/**
|
||||
* The user made changes to the network config and wants to save them, so
|
||||
* lets go ahead and do so.
|
||||
@ -143,6 +137,7 @@ public class ConfigTunnelsHandler extends FormHandler {
|
||||
addFormError(_("Error saving the configuration (applied but not saved) - please see the error logs."));
|
||||
}
|
||||
}
|
||||
|
||||
private static final int getInt(Object val) {
|
||||
if (val == null) return 0;
|
||||
String str = null;
|
||||
|
@ -4,6 +4,7 @@ import java.util.Iterator;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import net.i2p.data.DataHelper;
|
||||
import net.i2p.data.Destination;
|
||||
import net.i2p.router.TunnelPoolSettings;
|
||||
|
||||
@ -46,7 +47,7 @@ public class ConfigTunnelsHelper extends HelperBase {
|
||||
name = dest.calculateHash().toBase64().substring(0,6);
|
||||
|
||||
String prefix = dest.calculateHash().toBase64().substring(0,4);
|
||||
renderForm(buf, cur, prefix, _("Client tunnels for {0}", _(name)), in, out);
|
||||
renderForm(buf, cur, prefix, _("Client tunnels for {0}", DataHelper.escapeHTML(_(name))), in, out);
|
||||
cur++;
|
||||
}
|
||||
|
||||
|
@ -433,9 +433,9 @@ public class SummaryHelper extends HelperBase {
|
||||
buf.append("</td><td align=\"left\"><b><a href=\"tunnels#").append(h.toBase64().substring(0,4));
|
||||
buf.append("\" target=\"_top\" title=\"").append(_("Show tunnels")).append("\">");
|
||||
if (name.length() < 18)
|
||||
buf.append(name);
|
||||
buf.append(DataHelper.escapeHTML(name));
|
||||
else
|
||||
buf.append(name.substring(0,15)).append("…");
|
||||
buf.append(DataHelper.escapeHTML(name.substring(0,15))).append("…");
|
||||
buf.append("</a></b></td>\n");
|
||||
LeaseSet ls = _context.netDb().lookupLeaseSetLocally(h);
|
||||
if (ls != null && _context.tunnelManager().getOutboundClientTunnelCount(h) > 0) {
|
||||
|
@ -57,7 +57,7 @@ public class TunnelRenderer {
|
||||
if (name == null)
|
||||
name = client.toBase64().substring(0,4);
|
||||
out.write("<h2><a name=\"" + client.toBase64().substring(0,4)
|
||||
+ "\" ></a>" + _("Client tunnels for") + ' ' + _(name));
|
||||
+ "\" ></a>" + _("Client tunnels for") + ' ' + DataHelper.escapeHTML(_(name)));
|
||||
if (isLocal)
|
||||
out.write(" (<a href=\"/configtunnels#" + client.toBase64().substring(0,4) +"\">" + _("configure") + "</a>)</h2>\n");
|
||||
else
|
||||
|
Reference in New Issue
Block a user