This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str = ActiveSupport::SafeBuffer.new "<script>alert</script>" | |
CGI::unescapeHTML str | |
=>TypeError: can't dup NilClass | |
from /Users/marcm/.rvm/rubies/ree-1.8.7-2011.03/lib/ruby/1.8/cgi.rb:371:in `dup' | |
UnescapeHTML chokes b/c $1 = nil on line 371: | |
369 def CGI::unescapeHTML(string) | |
370 string.gsub(/&(amp|quot|gt|lt|\#[0-9]+|\#x[0-9A-Fa-f]+);/n) do | |
=> 371 match = $1.dup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Day job: Web developer | |
What is your language of choice: Ruby | |
Open Source contributions: mogli, cocos2d-javascript | |
How do you use GitHub: Private repos for work projects, public ones for everything else. Used with Capistrano deploys locally & for EngineYard deployment |
NewerOlder