diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/open-uri.rb | 2 | ||||
| -rw-r--r-- | lib/rexml/text.rb | 4 | ||||
| -rw-r--r-- | lib/rubygems/open-uri.rb | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/lib/open-uri.rb b/lib/open-uri.rb index a981f58ed..2b6cd8fd6 100644 --- a/lib/open-uri.rb +++ b/lib/open-uri.rb @@ -433,7 +433,7 @@ module OpenURI subtype = $2.downcase parameters = [] $3.scan(/;#{RE_LWS}?(#{RE_TOKEN})#{RE_LWS}?=#{RE_LWS}?(?:(#{RE_TOKEN})|(#{RE_QUOTED_STRING}))/no) {|att, val, qval| - val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/) { $1 ? $1[1,1] : $& } if qval + val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } if qval parameters << [att.downcase, val] } ["#{type}/#{subtype}", *parameters] diff --git a/lib/rexml/text.rb b/lib/rexml/text.rb index c23cd17c0..73a72ae52 100644 --- a/lib/rexml/text.rb +++ b/lib/rexml/text.rb @@ -50,7 +50,7 @@ module REXML | \xF0[\x90-\xBF][\x80-\xBF]{2} # planes 1-3 | [\xF1-\xF3][\x80-\xBF]{3} # planes 4-15 | \xF4[\x80-\x8F][\x80-\xBF]{2} # plane 16 - )*$/x; + )*$/nx; end # Constructor @@ -139,7 +139,7 @@ module REXML end end else - string.scan(/[\x00-\x7F]|[\x80-\xBF][\xC0-\xF0]*|[\xC0-\xF0]/) do |c| + string.scan(/[\x00-\x7F]|[\x80-\xBF][\xC0-\xF0]*|[\xC0-\xF0]/n) do |c| case c.unpack('U') when *VALID_CHAR else diff --git a/lib/rubygems/open-uri.rb b/lib/rubygems/open-uri.rb index ffc8e4857..50fa94374 100644 --- a/lib/rubygems/open-uri.rb +++ b/lib/rubygems/open-uri.rb @@ -426,7 +426,7 @@ module OpenURI subtype = $2.downcase parameters = [] $3.scan(/;#{RE_LWS}?(#{RE_TOKEN})#{RE_LWS}?=#{RE_LWS}?(?:(#{RE_TOKEN})|(#{RE_QUOTED_STRING}))/no) {|att, val, qval| - val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/) { $1 ? $1[1,1] : $& } if qval + val = qval.gsub(/[\r\n\t !#-\[\]-~\x80-\xff]+|(\\[\x00-\x7f])/n) { $1 ? $1[1,1] : $& } if qval parameters << [att.downcase, val] } ["#{type}/#{subtype}", *parameters] |
