View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0032385 | mantisbt | bugtracker | public | 2023-04-12 13:23 | 2023-10-31 16:32 |
Reporter | dregad | Assigned To | dregad | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Target Version | 2.26.0 | Fixed in Version | 2.26.0 | ||
Summary | 0032385: Incorrect use of mb_strimwidth() to truncate old/new values in history API | ||||
Description | 0024056 and 0025002 introduced use of mb_strimwidth() to ensure that History API does not attempt to insert bigger data than the underlying old_value and new_value database columns can accept. This works just fine with Western alphabets, but a string's width is NOT necessarily the same as its length. In Chinese, Japanese and Korean, some characters can be represented as full or half width, which may lead to unexpected results. In this case, if the string contains full-width chars, then it will be truncated to less than the expected 255 chars. Example:
| ||||
Tags | No tags attached. | ||||
related to | 0032365 | closed | dregad | APPLICATION ERROR 401 when writing Custom Fields with more than 255 characters |
related to | 0024056 | closed | atrol | Custom Fields of type "Textarea" cannot contain more than 255 chars due to bug_history table |
related to | 0025002 | closed | atrol | Error when updating content in a custom field of type "Text Area" ("Textbereich"): History cannot be stored |
MantisBT: master 47a44b35 2023-04-12 13:32 Details Diff |
New string_truncate() API function Truncate a string to the specified length, optionally appending a marker. This is intended to replace mb_strimwidth() calls when the truncation should be driven by the string's length and not its width. Issue 0032385 |
Affected Issues 0032385 |
|
mod - core/string_api.php | Diff File | ||
MantisBT: master fcb28a78 2023-04-12 13:34 Details Diff |
Use new string_truncate() instead of mb_strimwidth() This ensures that History API trunctates old_value and new_value to the expected 255 chars even when full-width CJK symbols are used. Fixes 0032385 |
Affected Issues 0032385 |
|
mod - core/history_api.php | Diff File |