Skip to content

Commit

Permalink
Assume that an XML declaration is at the beginning of a document
Browse files Browse the repository at this point in the history
  • Loading branch information
knu committed Nov 22, 2016
1 parent 0b37009 commit aa6d8be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/agents/rss_agent.rb
Expand Up @@ -179,7 +179,7 @@ def preprocessed_body(response)
else
# Encoding is already known, so do not let the parser detect
# it from the XML declaration in the content.
body.sub!(/(<\?xml(?:\s+\w+\s*=\s*(['"]).*?\2)*)\s+encoding\s*=\s*(['"]).*?\3/, '\\1')
body.sub!(/(\A\u{FEFF}?\s*<\?xml(?:\s+\w+\s*=\s*(['"]).*?\2)*)\s+encoding\s*=\s*(['"]).*?\3/, '\\1')
end
body
end
Expand Down

0 comments on commit aa6d8be

Please sign in to comment.