Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

regular expressions are usually ASCII-encoded, so force_encoding the …

…content of a Node to the encoding of the regular expression is wrong.
  • Loading branch information...
commit d6953cbfd3b6e06eceba715c60e288b6d7db0d49 1 parent a210aff
Yehuda Katz wycats authored
1  actionpack/lib/action_controller/vendor/html-scanner/html/tokenizer.rb
View
@@ -23,6 +23,7 @@ class Tokenizer #:nodoc:
# Create a new Tokenizer for the given text.
def initialize(text)
+ text.encode! if text.encoding_aware?
@scanner = StringScanner.new(text)
@position = 0
@line = 0
2  actionpack/lib/action_dispatch/testing/assertions/selector.rb
View
@@ -267,14 +267,12 @@ def assert_select(*args, &block)
if match_with = equals[:text]
matches.delete_if do |match|
text = ""
- text.force_encoding(match_with.encoding) if text.respond_to?(:force_encoding)
stack = match.children.reverse
while node = stack.pop
if node.tag?
stack.concat node.children.reverse
else
content = node.content
- content.force_encoding(match_with.encoding) if content.respond_to?(:force_encoding)
text << content
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.