Skip to content

Commit

Permalink
escaping
Browse files Browse the repository at this point in the history
  • Loading branch information
defunkt committed Jan 22, 2008
1 parent dbd59d5 commit 868ddb7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions subtle.rb
Expand Up @@ -166,13 +166,17 @@ def render_atom_feed(item)
`rm #{tmp_file}`

if err = stderr.read
erb %(<h3>Error Atomizing #{item.url}:</h3><p>#{err.gsub("\n", '<br/>')}</p>)
erb %(<h3>Error Atomizing #{item.url}:</h3><p>#{h(err).gsub("\n", '<br/>')}</p>)
else
File.open(@file, 'w') { |f| f.puts stdout.read }
sendfile @file
end
end

def h(text)
ERB::Util.h(text)
end

def xml!
@headers['Content-Type'] = 'application/xml'
end
Expand Down Expand Up @@ -283,4 +287,3 @@ def footer
</html>
end_html
end

0 comments on commit 868ddb7

Please sign in to comment.