From a0ccc0570257e327da15db9a0c907866ef56f69a Mon Sep 17 00:00:00 2001 From: Brent Smith Date: Sat, 1 Jul 2006 14:24:02 +0000 Subject: Fix to properly escape ampersand characters by using xmlNewTextChild, * src/yelp-toc-pager.c: (process_info_pending): Fix to properly escape ampersand characters by using xmlNewTextChild, patch from Daniel Drake. Fixes #343372 --- ChangeLog | 6 ++++++ src/yelp-toc-pager.c | 13 +++---------- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25a94abe..2c298ce9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-07-01 Brent Smith + + * src/yelp-toc-pager.c: (process_info_pending): Fix to properly escape + ampersand characters by using xmlNewTextChild, patch from Daniel + Drake. Fixes #343372 + 2006-06-30 Brent Smith * src/yelp-debug.c: (yelp_debug): Print DB_PROFILE message to the diff --git a/src/yelp-toc-pager.c b/src/yelp-toc-pager.c index 53af95ce..5980e0dc 100644 --- a/src/yelp-toc-pager.c +++ b/src/yelp-toc-pager.c @@ -1535,13 +1535,6 @@ process_info_pending (YelpTocPager *pager) g_io_channel_read_to_end (channel, &str, &len, NULL); g_io_channel_shutdown (channel, FALSE, NULL); g_io_channel_unref (channel); - /* Check the string for the special character '&' which - * screws up the xml. If its there, it needs escaping - */ - amp = g_strsplit (str, "&", -1); - g_free (str); - str = g_strjoinv ("&", amp); - g_strfreev (amp); files = g_strsplit (str, "\n", -1); @@ -1610,12 +1603,12 @@ process_info_pending (YelpTocPager *pager) NULL); xmlNewNsProp (tmp, NULL, BAD_CAST "href", BAD_CAST fname); - xmlNewChild (tmp, NULL, BAD_CAST "title", + xmlNewTextChild (tmp, NULL, BAD_CAST "title", BAD_CAST part2); - xmlNewChild (tmp, NULL, BAD_CAST "tooltip", + xmlNewTextChild (tmp, NULL, BAD_CAST "tooltip", BAD_CAST tooltip); - xmlNewChild (tmp, NULL, BAD_CAST "description", + xmlNewTextChild (tmp, NULL, BAD_CAST "description", BAD_CAST desc); } done: -- cgit v1.2.1