Changeset 16306 in josm


Ignore:
Timestamp:
2020-04-15T21:59:14+02:00 (5 years ago)
Author:
simon04
Message:

SearchDialog: escape HTML characters from SearchParseError

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/dialogs/SearchDialog.java

    r16268 r16306  
    233233                super.buttonAction(buttonIndex, evt);
    234234            } catch (SearchParseError | MapCSSException e) {
    235                 Logging.debug(e);
     235                Logging.warn(e);
     236                String message = Utils.escapeReservedCharactersHTML(e.getMessage()
     237                        .replace("<html>", "")
     238                        .replace("</html>", ""));
    236239                JOptionPane.showMessageDialog(
    237240                        MainApplication.getMainFrame(),
    238                         "<html>" + tr("Search expression is not valid: \n\n {0}",
    239                                 e.getMessage().replace("<html>", "").replace("</html>", "")).replace("\n", "<br>") +
    240                         "</html>",
     241                        "<html>" + tr("Search expression is not valid: \n\n {0}", message).replace("\n", "<br>") + "</html>",
    241242                        tr("Invalid search expression"),
    242243                        JOptionPane.ERROR_MESSAGE);
Note: See TracChangeset for help on using the changeset viewer.