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

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

Location:
trunk/src/org/openstreetmap/josm/actions
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/AbstractMergeAction.java

    r11017 r11848  
    2222import org.openstreetmap.josm.tools.GBC;
    2323import org.openstreetmap.josm.tools.Shortcut;
     24import org.openstreetmap.josm.tools.Utils;
    2425
    2526public abstract class AbstractMergeAction extends JosmAction {
     
    100101    protected void warnNoTargetLayersForSourceLayer(Layer sourceLayer) {
    101102        JOptionPane.showMessageDialog(Main.parent,
    102                 tr("<html>There are no layers the source layer<br>''{0}''<br>could be merged to.</html>", sourceLayer.getName()),
     103                tr("<html>There are no layers the source layer<br>''{0}''<br>could be merged to.</html>",
     104                        Utils.escapeReservedCharactersHTML(sourceLayer.getName())),
    103105                tr("No target layers"), JOptionPane.WARNING_MESSAGE);
    104106    }
  • trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java

    r11739 r11848  
    130130                        "<b>This is not the recommended way of merging such data</b>.<br />"+
    131131                        "You should instead check and merge each object, one by one, by using ''<i>Merge selection</i>''.<br /><br />"+
    132                         "Are you sure you want to continue?", sourceLayer.getName(), targetLayer.getName(), targetLayer.getName())+
     132                        "Are you sure you want to continue?",
     133                        Utils.escapeReservedCharactersHTML(sourceLayer.getName()),
     134                        Utils.escapeReservedCharactersHTML(targetLayer.getName()),
     135                        Utils.escapeReservedCharactersHTML(targetLayer.getName()))+
    133136                "</html>",
    134137                ImageProvider.get("dialogs", "mergedown"), tr("Ignore this hint and merge anyway"));
  • trunk/src/org/openstreetmap/josm/actions/MergeSelectionAction.java

    r10552 r11848  
    1818import org.openstreetmap.josm.tools.ImageProvider;
    1919import org.openstreetmap.josm.tools.Shortcut;
     20import org.openstreetmap.josm.tools.Utils;
    2021
    2122/**
     
    9091                        "You should instead check and merge each object, <b>one by one</b>.<br /><br />"+
    9192                        "Are you sure you want to continue?",
    92                         getLayerManager().getEditLayer().getName(), targetLayer.getName(), targetLayer.getName())+
     93                        Utils.escapeReservedCharactersHTML(getLayerManager().getEditLayer().getName()),
     94                        Utils.escapeReservedCharactersHTML(targetLayer.getName()),
     95                        Utils.escapeReservedCharactersHTML(targetLayer.getName()))+
    9396                "</html>",
    9497                ImageProvider.get("dialogs", "mergedown"), tr("Ignore this hint and merge anyway"));
  • trunk/src/org/openstreetmap/josm/actions/OpenFileAction.java

    r10601 r11848  
    3939import org.openstreetmap.josm.tools.MultiMap;
    4040import org.openstreetmap.josm.tools.Shortcut;
     41import org.openstreetmap.josm.tools.Utils;
    4142import org.xml.sax.SAXException;
    4243
     
    182183                        files.size(),
    183184                        files.size(),
    184                         importer.filter.getDescription()
     185                        Utils.escapeReservedCharactersHTML(importer.filter.getDescription())
    185186                    )
    186187            ).append("<br><ul>");
  • trunk/src/org/openstreetmap/josm/actions/SessionLoadAction.java

    r11746 r11848  
    190190                    Main.parent,
    191191                    tr("<html>Could not load session file ''{0}''.<br>Error is:<br>{1}</html>",
    192                             uri != null ? uri : file.getName(), e.getMessage()),
     192                            uri != null ? uri : file.getName(), Utils.escapeReservedCharactersHTML(e.getMessage())),
    193193                    dialogTitle,
    194194                    JOptionPane.ERROR_MESSAGE,
  • trunk/src/org/openstreetmap/josm/actions/SessionSaveAsAction.java

    r11109 r11848  
    170170            HelpAwareOptionPane.showMessageDialogInEDT(
    171171                    Main.parent,
    172                     tr("<html>Could not save session file ''{0}''.<br>Error is:<br>{1}</html>", file.getName(), ex.getMessage()),
     172                    tr("<html>Could not save session file ''{0}''.<br>Error is:<br>{1}</html>",
     173                            file.getName(), Utils.escapeReservedCharactersHTML(ex.getMessage())),
    173174                    tr("IO Error"),
    174175                    JOptionPane.ERROR_MESSAGE,
  • trunk/src/org/openstreetmap/josm/actions/UploadAction.java

    r11709 r11848  
    2929import org.openstreetmap.josm.tools.ImageProvider;
    3030import org.openstreetmap.josm.tools.Shortcut;
     31import org.openstreetmap.josm.tools.Utils;
    3132
    3233/**
     
    154155                Main.parent,
    155156                tr("<html>The data to be uploaded participates in unresolved conflicts of layer ''{0}''.<br>"
    156                         + "You have to resolve them first.</html>", layer.getName()
     157                        + "You have to resolve them first.</html>", Utils.escapeReservedCharactersHTML(layer.getName())
    157158                ),
    158159                tr("Warning"),
     
    173174                    "Sending data from this layer is <b>strongly discouraged</b>. If you continue,<br />"+
    174175                    "it may require you subsequently have to revert your changes, or force other contributors to.<br /><br />"+
    175                     "Are you sure you want to continue?", layer.getName())+
     176                    "Are you sure you want to continue?", Utils.escapeReservedCharactersHTML(layer.getName()))+
    176177                "</html>",
    177178                ImageProvider.get("upload"), tr("Ignore this hint and upload anyway"));
Note: See TracChangeset for help on using the changeset viewer.