/pidgin/main: cbe2085f6355: Fix :'( smiley bug by a tiny hack

Tomasz Wasilczyk twasilczyk at pidgin.im
Mon Apr 14 16:46:43 EDT 2014


Changeset: cbe2085f635546e91261b64f2c31fdf969ebc1a2
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-14 22:46 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/cbe2085f6355

Description:

Fix :'( smiley bug by a tiny hack

diffstat:

 libpurple/smiley-list.c |  12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diffs (22 lines):

diff --git a/libpurple/smiley-list.c b/libpurple/smiley-list.c
--- a/libpurple/smiley-list.c
+++ b/libpurple/smiley-list.c
@@ -144,6 +144,18 @@ purple_smiley_list_add(PurpleSmileyList 
 
 	shortcut_escaped = g_markup_escape_text(shortcut, -1);
 	succ = purple_trie_add(priv->trie, shortcut_escaped, smiley);
+
+	/* A special-case for WebKit, which unescapes apos entity.
+	 * Please, don't trust this hack - it may be removed in future releases.
+	 */
+	if (succ && strstr(shortcut_escaped, "'") != NULL) {
+		gchar *tmp = shortcut_escaped;
+		shortcut_escaped = purple_strreplace(shortcut_escaped,
+			"'", "'");
+		g_free(tmp);
+		succ = purple_trie_add(priv->trie, shortcut_escaped, smiley);
+	}
+
 	g_free(shortcut_escaped);
 	if (!succ)
 		return FALSE;



More information about the Commits mailing list