GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Rubygem
Description: A simple, flexible, extensible, and liberal RSS and Atom reader for Ruby. It is designed to be backwards compatible with the standard RSS parser, but will never do RSS generation.
Homepage: http://rubyforge.org/projects/simple-rss
Clone URL: git://github.com/cardmagic/simple-rss.git
A fix to unescaped content from Takeru Sasaki

git-svn-id: svn+ssh://rubyforge.org/var/svn/simple-rss/trunk@29 
b2309148-6e07-0410-9955-f6886f063a3d
cardmagic (author)
Fri Mar 24 00:37:31 -0800 2006
commit  ac95fb4cf69bbbe0d3a1a1c31f21bf2acbf25d1e
tree    f7647690f2f944057a493c3c0e78d1b4d9a3cd59
parent  437b6a6d698814343dbf6e82ddd2a2216ae932fa
...
122
123
124
125
126
127
 
 
 
 
 
 
 
128
129
130
...
122
123
124
 
 
 
125
126
127
128
129
130
131
132
133
134
0
@@ -122,9 +122,13 @@ class SimpleRSS
0
     tag.to_s.gsub(':','_').intern
0
   end
0
   
0
- def unescape(content)
0
- CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
0
- end
0
+ def unescape(content)
0
+ if content =~ /([^-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]]%)/n then
0
+ CGI.unescape(content).gsub(/(<!\[CDATA\[|\]\]>)/,'').strip
0
+ else
0
+ content
0
+ end
0
+ end
0
 end
0
 
0
 class SimpleRSSError < StandardError

Comments

    No one has commented yet.