Changeset a028bba


Ignore:
Timestamp:
Nov 12, 2015 8:39:58 PM (5 years ago)
Author:
zzz <zzz@…>
Branches:
master
Children:
8a1f02aa
Parents:
e93e76a
Message:

Console: Fix filtering and escaping on /configclients
Fix autostart setting on new client, was inverted

Files:
4 edited

Legend:

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

    re93e76a ra028bba  
    245245            if (_context.getBooleanProperty(ConfigClientsHelper.PROP_ENABLE_CLIENT_CHANGE) ||
    246246                isAdvanced()) {
    247                 String desc = getJettyString("desc" + cur);
     247                String desc = getJettyString("nofilter_desc" + cur);
    248248                if (desc != null) {
    249249                    int spc = desc.indexOf(" ");
     
    256256                    ca.className = clss;
    257257                    ca.args = args;
    258                     ca.clientName = getJettyString("name" + cur);
     258                    ca.clientName = getJettyString("nofilter_name" + cur);
    259259                }
    260260            }
     
    265265            isAdvanced()) {
    266266            int newClient = clients.size();
    267             String newDesc = getJettyString("desc" + newClient);
     267            String newDesc = getJettyString("nofilter_desc" + newClient);
    268268            if (newDesc != null && newDesc.trim().length() > 0) {
    269269                // new entry
     
    275275                    args = newDesc.substring(spc + 1);
    276276                }
    277                 String name = getJettyString("name" + newClient);
     277                String name = getJettyString("nofilter_name" + newClient);
    278278                if (name == null || name.trim().length() <= 0) name = "new client";
    279279                ClientAppConfig ca = new ClientAppConfig(clss, name, args, 2*60*1000,
    280                                                          _settings.get(newClient + ".enabled") != null);
     280                                                         _settings.get(newClient + ".enabled") == null);  // true for disabled
    281281                clients.add(ca);
    282282                addFormNotice(_t("New client added") + ": " + name + " (" + clss + ").");
  • apps/routerconsole/java/src/net/i2p/router/web/ConfigClientsHelper.java

    re93e76a ra028bba  
    323323                            boolean showEditButton, boolean showUpdateButton, boolean showStopButton,
    324324                            boolean showDeleteButton, boolean showStartButton) {
    325         String escapeddesc = DataHelper.escapeHTML(desc);
     325        String escapedName = DataHelper.escapeHTML(name);
     326        String escapedDesc = DataHelper.escapeHTML(desc);
    326327        buf.append("<tr><td class=\"mediumtags\" align=\"right\" width=\"25%\">");
    327328        if (urlify && enabled) {
    328329            String link = "/";
    329330            if (! RouterConsoleRunner.ROUTERCONSOLE.equals(name))
    330                 link += name + "/";
    331             buf.append("<a href=\"").append(link).append("\">").append(_t(name)).append("</a>");
     331                link += escapedName + "/";
     332            buf.append("<a href=\"").append(link).append("\">").append(_t(escapedName)).append("</a>");
    332333        } else if (edit && !ro) {
    333             buf.append("<input type=\"text\" name=\"name").append(index).append("\" value=\"");
     334            buf.append("<input type=\"text\" name=\"nofilter_name").append(index).append("\" value=\"");
    334335            if (name.length() > 0)
    335                 buf.append(_t(name));
     336                buf.append(_t(escapedName));
    336337            buf.append("\" >");
    337338        } else {
    338339            if (name.length() > 0)
    339                 buf.append(_t(name));
    340         }
    341         buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\" value=\"true\" ");
     340                buf.append(_t(escapedName));
     341        }
     342        buf.append("</td><td align=\"center\" width=\"10%\"><input type=\"checkbox\" class=\"optbox\" name=\"").append(index).append(".enabled\"");
    342343        if (enabled) {
    343344            buf.append("checked=\"checked\" ");
     
    367368            buf.append("<button type=\"submit\" class=\"Xdelete\" name=\"action\" value=\"Delete ").append(index)
    368369               .append("\" onclick=\"if (!confirm('")
    369                .append(_t("Are you sure you want to delete {0}?", _t(name)))
     370               .append(_t("Are you sure you want to delete {0}?", _t(escapedName)))
    370371               .append("')) { return false; }\">")
    371372               .append(_t("Delete")).append("<span class=hide> ").append(index).append("</span></button>");
     
    373374        buf.append("</td><td align=\"left\" width=\"50%\">");
    374375        if (edit && !ro) {
    375             buf.append("<input type=\"text\" size=\"80\" spellcheck=\"false\" name=\"desc").append(index).append("\" value=\"");
    376             buf.append(escapeddesc);
     376            buf.append("<input type=\"text\" size=\"80\" spellcheck=\"false\" name=\"nofilter_desc").append(index).append("\" value=\"");
     377            buf.append(escapedDesc);
    377378            buf.append("\" >");
    378379        } else {
    379             buf.append(desc);
     380            buf.append(escapedDesc);
    380381        }
    381382        buf.append("</td></tr>\n");
  • history.txt

    re93e76a ra028bba  
     12015-11-12 zzz
     2 * Console /configclients:
     3   = Fix filtering and escaping
     4   - Fix autostart setting on new client, was inverted
     5
    162015-11-11 zzz
    27 * i2psnark:
    3    - Change log level to hide socket closed error at tunnel shutdown
     8   - Change log level to hide socket closed error at tunnel shutdown (ticket #1687)
    49   - Increase max pieces
    510 * Timers: State fix 4th try (tickets #1694, #1705)
    611
    7122015-11-05 zzz
    8  * I2CP: Fix additional connections getting rejected during tunnel open (ticket #1650)
     13 * I2CP: Fix additional connections getting rejected during tunnel open (tickets #1650, #1698)
    914 * Streaming: Split blacklist into one for EC and one for Ed
    1015
  • router/java/src/net/i2p/router/RouterVersion.java

    re93e76a ra028bba  
    1919    public final static String ID = "Monotone";
    2020    public final static String VERSION = CoreVersion.VERSION;
    21     public final static long BUILD = 25;
     21    public final static long BUILD = 26;
    2222
    2323    /** for example "-test" */
Note: See TracChangeset for help on using the changeset viewer.