diff options
author | Jamis Buck <jamis@37signals.com> | 2005-06-06 16:12:38 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-06-06 16:12:38 +0000 |
commit | 481d579734ac077f69fcd2db69c3dffdfd6f260a (patch) | |
tree | 00e79637081b5cd7e0c16ae73f8638bcb99d6628 /actionmailer/lib | |
parent | cf1e2a84fff32ab1cf2a736bb99c53e830d92db3 (diff) | |
download | rails-481d579734ac077f69fcd2db69c3dffdfd6f260a.tar.gz rails-481d579734ac077f69fcd2db69c3dffdfd6f260a.tar.bz2 rails-481d579734ac077f69fcd2db69c3dffdfd6f260a.zip |
Don't error while processing encoded attachment names #1340 [lon@speedymac.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1390 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer/lib')
-rwxr-xr-x | actionmailer/lib/action_mailer/vendor/tmail/utils.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/actionmailer/lib/action_mailer/vendor/tmail/utils.rb b/actionmailer/lib/action_mailer/vendor/tmail/utils.rb index 57df234464..57919473f1 100755 --- a/actionmailer/lib/action_mailer/vendor/tmail/utils.rb +++ b/actionmailer/lib/action_mailer/vendor/tmail/utils.rb @@ -206,8 +206,12 @@ module TMail def decode_RFC2231( str ) m = RFC2231_ENCODED.match(str) or return str - NKF.nkf(NKF_FLAGS[$KCODE], - m.post_match.gsub(/%[\da-f]{2}/in) {|s| s[1,2].hex.chr }) + begin + NKF.nkf(NKF_FLAGS[$KCODE], + m.post_match.gsub(/%[\da-f]{2}/in) {|s| s[1,2].hex.chr }) + rescue + m.post_match.gsub(/%[\da-f]{2}/in, "") + end end end |