Commit a8017097 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

use byte length when choose between Content and LargeContent

DBIx::SB truncate data using bytes (even if DB supports characters),
so 255 is length in bytes and we have to use the same algorithm in RT.
parent a4e5bc19
......@@ -68,9 +68,9 @@ sub Create {
@_,
);
if ( defined $args{'Content'} && length( $args{'Content'} ) > 255 ) {
if ( defined $args{'Content'} && length( Encode::encode_utf8($args{'Content'}) ) > 255 ) {
if ( defined $args{'LargeContent'} && length $args{'LargeContent'} ) {
$RT::Logger->error("Content is longer than 255 and LargeContent specified");
$RT::Logger->error("Content is longer than 255 bytes and LargeContent specified");
}
else {
$args{'LargeContent'} = $args{'Content'};
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment