mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
[ruby-core:40945] [Bug #5620] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35054 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5308538bef
commit
ed07df5ab5
3 changed files with 26 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Mar 16 13:50:12 2012 Shugo Maeda <shugo@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/net/imap.rb (rfc822_text): ignore [] after RFC822.
|
||||||
|
[ruby-core:40945] [Bug #5620]
|
||||||
|
|
||||||
Fri Mar 16 12:00:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Fri Mar 16 12:00:42 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* vm_insnhelper.c (argument_error): use line number at the beginning
|
* vm_insnhelper.c (argument_error): use line number at the beginning
|
||||||
|
|
|
@ -2281,6 +2281,11 @@ module Net
|
||||||
def rfc822_text
|
def rfc822_text
|
||||||
token = match(T_ATOM)
|
token = match(T_ATOM)
|
||||||
name = token.value.upcase
|
name = token.value.upcase
|
||||||
|
token = lookahead
|
||||||
|
if token.symbol == T_LBRA
|
||||||
|
shift_token
|
||||||
|
match(T_RBRA)
|
||||||
|
end
|
||||||
match(T_SPACE)
|
match(T_SPACE)
|
||||||
return name, nstring
|
return name, nstring
|
||||||
end
|
end
|
||||||
|
|
|
@ -126,4 +126,20 @@ EOF
|
||||||
}
|
}
|
||||||
assert_match(/ for \{123\}/, e.message)
|
assert_match(/ for \{123\}/, e.message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_msg_att_rfc822_text
|
||||||
|
parser = Net::IMAP::ResponseParser.new
|
||||||
|
response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
|
||||||
|
* 123 FETCH (RFC822 {5}
|
||||||
|
foo
|
||||||
|
)
|
||||||
|
EOF
|
||||||
|
assert_equal("foo\r\n", response.data.attr["RFC822"])
|
||||||
|
response = parser.parse(<<EOF.gsub(/\n/, "\r\n").taint)
|
||||||
|
* 123 FETCH (RFC822[] {5}
|
||||||
|
foo
|
||||||
|
)
|
||||||
|
EOF
|
||||||
|
assert_equal("foo\r\n", response.data.attr["RFC822"])
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue