From 5a78bb71ba6c2b6ede7d3a891a4e1c37d7fb4d71 Mon Sep 17 00:00:00 2001 From: Tony George Date: Sat, 15 Oct 2022 12:43:30 +0530 Subject: [PATCH] #939, #937: Fix crash on ArchLinux and Ubuntu 22.10 Kinetic This seems to be an issue with glib2 2.74 and strings that contain a improper unicode escape code (\uXX instead of /uXXXX). Since this function is used by all the progress windows, creating or deleting snapshots from the GUI was causing a crash. --- src/Utility/TeeJee.Misc.vala | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/src/Utility/TeeJee.Misc.vala b/src/Utility/TeeJee.Misc.vala index 360e205c..524e2521 100644 --- a/src/Utility/TeeJee.Misc.vala +++ b/src/Utility/TeeJee.Misc.vala @@ -149,27 +149,9 @@ namespace TeeJee.Misc { return new_txt; } - public string escape_html(string html, bool pango_markup = true){ - string txt = html; - - if (pango_markup){ - txt = txt - .replace("\\u00", "") - .replace("\\x" , ""); - } - else{ - txt = txt - .replace(" ", " "); //pango markup throws an error with   - } + public string escape_html(string html){ - txt = txt - .replace("&" , "&") - .replace("\"", """) - .replace("<" , "<") - .replace(">" , ">") - ; - - return txt; + return GLib.Markup.escape_text(html); } public string unescape_html(string html){