Patch #4307

Models fails to validate localized field names since ruby 1.9.1p343 and 1.9.2p

Added by Alexey Froloff almost 8 years ago. Updated over 2 years ago.

Status:ClosedStart date:2009-11-29
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Ruby support
Target version:-

Description

Revisions 24544 (trunk) and 25941 (ruby_1_9_1) comes with "\d, \s and \w are now non Unicode class. [ruby-dev:39026]", which breaks validations like "validates_format_of :name, :with => /^[\w\s\'\-]*$/i".

Replace \s with [:space:] and \w with [:word:], patch attached.

0001-Ruby-1.9.1p343-breaks-w-and-s-replace-with-word-and-.patch Magnifier (6.68 KB) Alexey Froloff, 2009-11-29 17:07


Related issues

Related to Redmine - Defect #5152: Cannot use certain characters for user and role names. Closed 2010-03-22

History

#1 Updated by Jean-Philippe Lang almost 7 years ago

  • Category set to Ruby support

Unfortunately, this patch breaks ruby1.8 support (tested with 1.8.7p302):

irb(main):012:0> /^[[:word:][:space:]\.\'\-]*$/i
SyntaxError: compile error
(irb):12: invalid regular expression; [:word:] is not a character class: /^[[:word:][:space:]\.\'\-]*$/
        from (irb):12
        from :0

#2 Updated by Go MAEDA over 2 years ago

  • Status changed from New to Closed

These 'validates_format_of' are removed by #5152 (Redmine 1.2.0).
Now we can use any characters for names.

#3 Updated by Go MAEDA over 2 years ago

  • Related to Defect #5152: Cannot use certain characters for user and role names. added

Also available in: Atom PDF