[vlc-commits] metachannels: properly resolve xml entities

Pierre Ynard git at videolan.org
Sun Feb 12 00:49:01 CET 2012


vlc | branch: master | Pierre Ynard <linkfanel at yahoo.fr> | Sun Feb 12 00:48:52 2012 +0100| [d739fe06b6921a08828bf2f4cd618e9d069bf329] | committer: Pierre Ynard

metachannels: properly resolve xml entities

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d739fe06b6921a08828bf2f4cd618e9d069bf329
---

 share/lua/sd/metachannels.lua |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/share/lua/sd/metachannels.lua b/share/lua/sd/metachannels.lua
index b1cdb5d..da593c4 100644
--- a/share/lua/sd/metachannels.lua
+++ b/share/lua/sd/metachannels.lua
@@ -37,11 +37,11 @@ function search( string )
     for _,item in ipairs( channel.children ) do
         if( item.name == 'item' ) then
             simplexml.add_name_maps( item )
-            local url = string.gsub( item.children_map['link'][1].children[1], '&', '&' )
-            local title = item.children_map['title'][1].children[1]
+            local url = vlc.strings.resolve_xml_special_chars( item.children_map['link'][1].children[1] )
+            local title = vlc.strings.resolve_xml_special_chars( item.children_map['title'][1].children[1] )
             local arturl = nil
             if item.children_map['media:thumbnail'] ~= nil then
-                arturl = item.children_map['media:thumbnail'][1].attributes['url']
+                arturl = vlc.strings.resolve_xml_special_chars( item.children_map['media:thumbnail'][1].attributes['url'] )
                 if( arturl == '/images/thumb_channel_default.jpg' ) then
                     arturl = 'http://www.metachannels.com/images/thumb_channel_default.jpg'
                 end
@@ -60,11 +60,11 @@ function main()
     for _,item in ipairs( channel.children ) do
         if( item.name == 'item' ) then
             simplexml.add_name_maps( item )
-            local url = string.gsub( item.children_map['link'][1].children[1], '&', '&' )
-            local title = item.children_map['title'][1].children[1]
+            local url = vlc.strings.resolve_xml_special_chars( item.children_map['link'][1].children[1] )
+            local title = vlc.strings.resolve_xml_special_chars( item.children_map['title'][1].children[1] )
             local arturl = nil
             if item.children_map['image'] ~= nil then
-                arturl = item.children_map['image'][1].children_map['url'][1].children[1]
+                arturl = vlc.strings.resolve_xml_special_chars( item.children_map['image'][1].children_map['url'][1].children[1] )
             end
             local node = vlc.sd.add_item( { path = url,
                                             title = title,



More information about the vlc-commits mailing list