Changeset 819504f


Ignore:
Timestamp:
Aug 23, 2014 1:44:56 PM (6 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
68b15aa
Parents:
e65ec2a
Message:

console escape fixes and cleanups

Location:
apps/routerconsole/java/src/net/i2p/router/web
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHandler.java

    re65ec2a r819504f  
    1111/**
    1212 * Handler to deal with form submissions from the tunnel config form and act
    13  * upon the values.  Holy crap, this is UUUUGLY
     13 * upon the values.
    1414 *
    1515 */
    1616public class ConfigTunnelsHandler extends FormHandler {
    17     private Map _settings;
     17
    1818    private boolean _shouldSave;
    19    
    20     public ConfigTunnelsHandler() {
    21         _shouldSave = false;
    22     }
    2319   
    2420    @Override
     
    3531            _shouldSave = true;
    3632    }
    37    
    38     public void setSettings(Map settings) { _settings = new HashMap(settings); }
    3933   
    4034    /**
     
    144138        }
    145139    }
     140
    146141    private static final int getInt(Object val) {
    147142        if (val == null) return 0;
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigTunnelsHelper.java

    re65ec2a r819504f  
    55import java.util.Set;
    66
     7import net.i2p.data.DataHelper;
    78import net.i2p.data.Destination;
    89import net.i2p.router.TunnelPoolSettings;
     
    4748       
    4849            String prefix = dest.calculateHash().toBase64().substring(0,4);
    49             renderForm(buf, cur, prefix, _("Client tunnels for {0}", _(name)), in, out);
     50            renderForm(buf, cur, prefix, _("Client tunnels for {0}", DataHelper.escapeHTML(_(name))), in, out);
    5051            cur++;
    5152        }
  • apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java

    re65ec2a r819504f  
    434434                buf.append("\" target=\"_top\" title=\"").append(_("Show tunnels")).append("\">");
    435435                if (name.length() < 18)
    436                     buf.append(name);
     436                    buf.append(DataHelper.escapeHTML(name));
    437437                else
    438                     buf.append(name.substring(0,15)).append("&hellip;");
     438                    buf.append(DataHelper.escapeHTML(name.substring(0,15))).append("&hellip;");
    439439                buf.append("</a></b></td>\n");
    440440                LeaseSet ls = _context.netDb().lookupLeaseSetLocally(h);
  • apps/routerconsole/java/src/net/i2p/router/web/TunnelRenderer.java

    re65ec2a r819504f  
    5858                name = client.toBase64().substring(0,4);
    5959            out.write("<h2><a name=\"" + client.toBase64().substring(0,4)
    60                       + "\" ></a>" + _("Client tunnels for") + ' ' + _(name));
     60                      + "\" ></a>" + _("Client tunnels for") + ' ' + DataHelper.escapeHTML(_(name)));
    6161            if (isLocal)
    6262                out.write(" (<a href=\"/configtunnels#" + client.toBase64().substring(0,4) +"\">" + _("configure") + "</a>)</h2>\n");
Note: See TracChangeset for help on using the changeset viewer.