Ignore:
Timestamp:
2017-04-07T00:18:07+02:00 (4 years ago)
Author:
Don-vip
Message:

fix #14613 - Special HTML characters not escaped in GUI error messages

Location:
trunk/src/org/openstreetmap/josm/plugins
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/plugins/PluginHandler.java

    r11746 r11848  
    350350            String msg = tr("<html>Loading of the plugin \"{0}\" was requested."
    351351                    + "<br>This plugin is no longer developed and very likely will produce errors."
    352                     +"<br>It should be disabled.<br>Delete from preferences?</html>", unmaintained);
     352                    +"<br>It should be disabled.<br>Delete from preferences?</html>",
     353                    Utils.escapeReservedCharactersHTML(unmaintained));
    353354            if (confirmDisablePlugin(parent, msg, unmaintained)) {
    354355                Main.pref.removeFromCollection("plugins", unmaintained);
     
    506507                "Plugin {0} requires {1} plugins which were not found. The missing plugins are:",
    507508                missingRequiredPlugin.size(),
    508                 plugin,
     509                Utils.escapeReservedCharactersHTML(plugin),
    509510                missingRequiredPlugin.size()))
    510511          .append(Utils.joinAsHtmlUnorderedList(missingRequiredPlugin))
     
    723724            if (e.getCause() instanceof ClassNotFoundException) {
    724725                msg = tr("<html>Could not load plugin {0} because the plugin<br>main class ''{1}'' was not found.<br>"
    725                         + "Delete from preferences?</html>", plugin.name, plugin.className);
     726                        + "Delete from preferences?</html>", Utils.escapeReservedCharactersHTML(plugin.name), plugin.className);
    726727            }
    727728        } catch (RuntimeException e) { // NOPMD
     
    919920          .append("<ul>");
    920921        for (PluginInformation pi: plugins) {
    921             sb.append("<li>").append(pi.name).append("</li>");
     922            sb.append("<li>").append(Utils.escapeReservedCharactersHTML(pi.name)).append("</li>");
    922923        }
    923924        sb.append("</ul>")
     
    12701271        final StringBuilder msg = new StringBuilder(256);
    12711272        msg.append("<html>")
    1272            .append(tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.", plugin.getPluginInformation().name))
     1273           .append(tr("An unexpected exception occurred that may have come from the ''{0}'' plugin.",
     1274                   Utils.escapeReservedCharactersHTML(plugin.getPluginInformation().name)))
    12731275           .append("<br>");
    12741276        if (plugin.getPluginInformation().author != null) {
    1275             msg.append(tr("According to the information within the plugin, the author is {0}.", plugin.getPluginInformation().author))
     1277            msg.append(tr("According to the information within the plugin, the author is {0}.",
     1278                    Utils.escapeReservedCharactersHTML(plugin.getPluginInformation().author)))
    12761279               .append("<br>");
    12771280        }
  • trunk/src/org/openstreetmap/josm/plugins/PluginInformation.java

    r11553 r11848  
    298298        StringBuilder sb = new StringBuilder(128);
    299299        sb.append("<html><body>")
    300           .append(description == null ? tr("no description available") : description);
     300          .append(description == null ? tr("no description available") : Utils.escapeReservedCharactersHTML(description));
    301301        if (link != null) {
    302302            sb.append(" <a href=\"").append(link).append("\">").append(tr("More info...")).append("</a>");
Note: See TracChangeset for help on using the changeset viewer.