diff options
author | Michael Koziarski <michael@koziarski.com> | 2007-08-05 00:51:16 +0000 |
---|---|---|
committer | Michael Koziarski <michael@koziarski.com> | 2007-08-05 00:51:16 +0000 |
commit | 73f72eeec2d0cc689735f52de4a5c3c80c4c1e85 (patch) | |
tree | 1a996f0bd7b8b022116beb722096fef40dd7b237 /activesupport/lib/active_support/multibyte | |
parent | fe3e03e7708c576d5b09fb161e68d715796eae67 (diff) | |
download | rails-73f72eeec2d0cc689735f52de4a5c3c80c4c1e85.tar.gz rails-73f72eeec2d0cc689735f52de4a5c3c80c4c1e85.tar.bz2 rails-73f72eeec2d0cc689735f52de4a5c3c80c4c1e85.zip |
Make the utf-handler return the correct value for non-matching regular expressions. Closes #9049 [manfred]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7273 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/active_support/multibyte')
-rw-r--r-- | activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb index 6ca043ae21..e4ef98f1b6 100644 --- a/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb +++ b/activesupport/lib/active_support/multibyte/handlers/utf8_handler.rb @@ -316,8 +316,8 @@ module ActiveSupport::Multibyte::Handlers #:nodoc: # Used to translate an offset from bytes to characters, for instance one received from a regular expression match def translate_offset(str, byte_offset) - return 0 if str == '' return nil if byte_offset.nil? + return 0 if str == '' chunk = str[0..byte_offset] begin begin |