Commit fd2919d5 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Bug #5640 / UTF8 encoded strings: MAX LENGTH wrong

parent 2d89c225
......@@ -1102,7 +1102,7 @@ abstract class AbstractBuildForm {
if ($formElement[FE_MAX_LENGTH] > 0 && $value !== '') {
// crop string only if it's not empty (substr returns false on empty strings)
$value = substr($value, 0, $formElement[FE_MAX_LENGTH]);
$value = mb_substr($value, 0, $formElement[FE_MAX_LENGTH]);
}
// 'maxLength' needs an upper 'L': naming convention for DB tables!
if ($formElement[FE_MAX_LENGTH] > 0) {
......
......@@ -620,7 +620,6 @@ class Report {
$assoc[REPORT_TOKEN_FINAL_VALUE . $keyAssoc] = $renderedColumn;
}
if ($flagOutput) {
//prints
$content .= $this->variables->doVariables($fsep);
......@@ -659,10 +658,16 @@ class Report {
$flagOutput = true;
$dummy = false;
// Empty column names are allowed: check with isset
// Special column name: '_...'? Empty column names are allowed: check with isset
if (isset($columnName[0]) && $columnName[0] === TOKEN_COLUMN_CTRL) {
$flagControl = true;
$columnName = substr($columnName, 1);
// Special column name and hide output: '__...'? (double '_' at the beginning)
if (isset($columnName[0]) && $columnName[0] === TOKEN_COLUMN_CTRL) {
$flagOutput = false;
$columnName = substr($columnName, 1);
}
}
//TODO: reserved names,not starting with '_' will be still accepted - stop this!
......
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