mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 10:19:23 +02:00
GT-2698 - fix html escaping to use simpler method.
This commit is contained in:
parent
6448f0da8f
commit
fa7173f9ab
60 changed files with 109 additions and 119 deletions
|
@ -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 " +
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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"));
|
||||
|
||||
|
|
|
@ -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>");
|
||||
|
|
|
@ -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("");
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue