GT-2698 - fix html escaping to use simpler method.

This commit is contained in:
dev747368 2019-04-15 18:18:15 -04:00
parent 6448f0da8f
commit fa7173f9ab
60 changed files with 109 additions and 119 deletions

View file

@ -1191,7 +1191,7 @@ public class FrontEndPlugin extends Plugin
// assume no tools in the tool chest
Msg.showInfo(this, tool.getToolFrame(), "Cannot Find Tool",
"<html>Cannot find tool to open file: <b>" +
HTMLUtilities.friendlyEncodeHTML(domainFile.getName()) +
HTMLUtilities.escapeHTML(domainFile.getName()) +
"</b>.<br><br>Make sure you have an appropriate tool installed <br>from the " +
"<b>Tools->Import Default Tools...</b> menu. Alternatively, you can " +
"use <b>Tool->Set Tool Associations</b> menu to change how Ghidra " +

View file

@ -139,13 +139,13 @@ class ToolButton extends EmptyBorderButton implements Draggable, Droppable {
public String getToolTipText(MouseEvent event) {
if (associatedRunningTool != null) {
if (associatedRunningTool instanceof PluginTool) {
return "<html>" + HTMLUtilities.friendlyEncodeHTML(
return "<html>" + HTMLUtilities.escapeHTML(
((PluginTool) associatedRunningTool).getToolFrame().getTitle());
}
return "<html>" + HTMLUtilities.friendlyEncodeHTML(associatedRunningTool.getName());
return "<html>" + HTMLUtilities.escapeHTML(associatedRunningTool.getName());
}
return "<html>" + HTMLUtilities.friendlyEncodeHTML(template.getName());
return "<html>" + HTMLUtilities.escapeHTML(template.getName());
}
public void launchTool(DomainFile domainFile) {

View file

@ -90,7 +90,7 @@ public class ProjectDataDeleteAction extends ProjectDataContextAction {
if (!selectedFiles.isEmpty()) {
DomainFile file = CollectionUtils.any(selectedFiles);
return "<HTML>Are you sure you want to <B><U>permanently</U></B> delete \"" +
HTMLUtilities.friendlyEncodeHTML(file.getName()) + "\"?";
HTMLUtilities.escapeHTML(file.getName()) + "\"?";
}
// only folders are selected, but they contain files

View file

@ -33,7 +33,7 @@ public class ProjectDataOpenToolAction extends ProjectDataContextAction {
public ProjectDataOpenToolAction(String owner, String group, String toolName, Icon icon) {
super("Open" + toolName, owner);
this.toolName = toolName;
String[] menuPath = { "Open With", HTMLUtilities.friendlyEncodeHTML(toolName) };
String[] menuPath = { "Open With", HTMLUtilities.escapeHTML(toolName) };
setPopupMenuData(new MenuData(menuPath, icon, "Open"));
setHelpLocation(new HelpLocation(owner, "Open_File_With"));

View file

@ -175,7 +175,7 @@ public abstract class AbstractDetailsPanel extends JPanel {
buffer.append("<B>");
}
buffer.append(HTMLUtilities.friendlyEncodeHTML(string));
buffer.append(HTMLUtilities.escapeHTML(string));
if (isBold) {
buffer.append("</B>");

View file

@ -720,7 +720,7 @@ public class KeyBindingsPanel extends JPanel {
if (description == null || description.trim().isEmpty()) {
description = actions.get(0).getName();
}
statusLabel.setText("<html>" + HTMLUtilities.friendlyEncodeHTML(description));
statusLabel.setText("<html>" + HTMLUtilities.escapeHTML(description));
}
catch (Exception ex) {
statusLabel.setText("");

View file

@ -142,9 +142,9 @@ class PluginInstallerTableModel
if (pluginsThatUseTarget.isEmpty() ||
OptionDialog.showYesNoDialog(parentComponent, "Confirm plugin removal",
"<html>Other plugins depend on " +
HTMLUtilities.friendlyEncodeHTML(targetPluginDescription.getName()) +
"<p><p>" + "Removing it will also remove:" + dependenciesToUnloadHtmlList +
"<p><p>" + "Continue?") == OptionDialog.YES_OPTION) {
HTMLUtilities.escapeHTML(targetPluginDescription.getName()) + "<p><p>" +
"Removing it will also remove:" + dependenciesToUnloadHtmlList + "<p><p>" +
"Continue?") == OptionDialog.YES_OPTION) {
model.removePlugin(targetPluginDescription);
}

View file

@ -209,9 +209,8 @@ public class DefaultProject implements Project {
return null;
}
String projectStr = "Project: " + HTMLUtilities.friendlyEncodeHTML(locator.getLocation()) +
System.getProperty("file.separator") +
HTMLUtilities.friendlyEncodeHTML(locator.getName());
String projectStr = "Project: " + HTMLUtilities.escapeHTML(locator.getLocation()) +
System.getProperty("file.separator") + HTMLUtilities.escapeHTML(locator.getName());
String lockInformation = lock.getExistingLockFileInformation();
if (!lock.canForceLock()) {
Msg.showInfo(getClass(), null, "Project Locked",

View file

@ -57,9 +57,8 @@ public class SelectChangedToolDialog extends DialogComponentProvider {
JPanel panel = new JPanel(new BorderLayout());
String toolName = toolList.get(0).getToolName();
JLabel descriptionLabel =
new GHtmlLabel(HTMLUtilities.toHTML("There are multiple changed instances of " +
HTMLUtilities.friendlyEncodeHTML(toolName) +
JLabel descriptionLabel = new GHtmlLabel(HTMLUtilities.toHTML(
"There are multiple changed instances of " + HTMLUtilities.escapeHTML(toolName) +
" running.<p>Which one would like to save to your tool chest?"));
descriptionLabel.setIconTextGap(15);
descriptionLabel.setIcon(OptionDialog.getIconForMessageType(OptionDialog.WARNING_MESSAGE));