diff options
author | Mark Wells <mark@freeside.biz> | 2014-03-12 14:08:54 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2014-03-12 14:08:54 -0700 |
commit | f32ff6851340686b53a757dc56dc3c8831b50395 (patch) | |
tree | eaafda27ff2cda9c10563d58fde09e6097d8cc49 /FS/FS/Record.pm | |
parent | b0edcdbd9bbc710db3abd0340d925e0fa744d649 (diff) |
allow utf8 characters in CDR details, #28102
Diffstat (limited to 'FS/FS/Record.pm')
-rw-r--r-- | FS/FS/Record.pm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index a47cc8bc1..a68442582 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -2497,8 +2497,10 @@ sub ut_text { #warn "msgcat ". \&msgcat. "\n"; #warn "notexist ". \¬exist. "\n"; #warn "AUTOLOAD ". \&AUTOLOAD. "\n"; + # \p{Word} = alphanumerics, marks (diacritics), and connectors + # see perldoc perluniprops $self->getfield($field) - =~ /^([\wô \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]\<\>$money_char]+)$/ + =~ /^([\p{Word} \!\@\#\$\%\&\(\)\-\+\;\:\'\"\,\.\?\/\=\[\]\<\>$money_char]+)$/ or return gettext('illegal_or_empty_text'). " $field: ". $self->getfield($field); $self->setfield($field,$1); @@ -2872,7 +2874,7 @@ May not be null. sub ut_name { my( $self, $field ) = @_; # warn "ut_name allowed alphanumerics: +(sort grep /\w/, map { chr() } 0..255), "\n"; - $self->getfield($field) =~ /^([\w \,\.\-\']+)$/ + $self->getfield($field) =~ /^([\p{Word} \,\.\-\']+)$/ or return gettext('illegal_name'). " $field: ". $self->getfield($field); my $name = $1; $name =~ s/^\s+//; @@ -3332,6 +3334,8 @@ sub _quote { my $column_type = $column_obj->type; my $nullable = $column_obj->null; + utf8::upgrade($value); + warn " $table.$column: $value ($column_type". ( $nullable ? ' NULL' : ' NOT NULL' ). ")\n" if $DEBUG > 2; |