Fix empty dialog messages
Escape ampersands and angle brackets in some Gtk::MessageDialogs. Closes #6306.
This commit is contained in:
@@ -221,7 +221,7 @@ bool confirmOverwrite (Gtk::Window& parent, const std::string& filename)
|
||||
bool safe = true;
|
||||
|
||||
if (Glib::file_test (filename, Glib::FILE_TEST_EXISTS)) {
|
||||
Glib::ustring msg_ = Glib::ustring ("<b>\"") + Glib::path_get_basename (filename) + "\": "
|
||||
Glib::ustring msg_ = Glib::ustring ("<b>\"") + escapeHtmlChars(Glib::path_get_basename (filename)) + "\": "
|
||||
+ M("MAIN_MSG_ALREADYEXISTS") + "</b>\n" + M("MAIN_MSG_QOVERWRITE");
|
||||
Gtk::MessageDialog msgd (parent, msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true);
|
||||
safe = (msgd.run () == Gtk::RESPONSE_YES);
|
||||
@@ -232,7 +232,7 @@ bool confirmOverwrite (Gtk::Window& parent, const std::string& filename)
|
||||
|
||||
void writeFailed (Gtk::Window& parent, const std::string& filename)
|
||||
{
|
||||
Glib::ustring msg_ = Glib::ustring::compose(M("MAIN_MSG_WRITEFAILED"), filename);
|
||||
Glib::ustring msg_ = Glib::ustring::compose(M("MAIN_MSG_WRITEFAILED"), escapeHtmlChars(filename));
|
||||
Gtk::MessageDialog msgd (parent, msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
|
||||
msgd.run ();
|
||||
}
|
||||
|
Reference in New Issue
Block a user