Commit 69f3eac4 authored by Elias Villiger's avatar Elias Villiger
Browse files

B3850 - Change set input maxlength - refs #3850, closes #3850

parent 8203e8f7
Pipeline #985 passed with stage
in 1 minute and 49 seconds
......@@ -1093,18 +1093,24 @@ class Support {
}
/**
* Get the strlen of the longest element in enum('val1','val2',...,'valn') or set('val1','val2',...,'valn')
* Get the strlen of the longest element in enum('val1','val2',...,'valn')
* or the maximum total length of a set('val1','val2',...,'valn')
*
* @param string $typeSpec
*
* @return int
*/
private static function maxLengthSetEnum($typeSpec) {
$startPos = (substr($typeSpec, 0, 4) === 'set(') ? 4 : 5;
$isSet = substr($typeSpec, 0, 4) === 'set(';
$startPos = $isSet ? 4 : 5;
$max = 0;
$valueList = substr($typeSpec, $startPos, strlen($typeSpec) - $startPos - 1);
$valueArr = explode(',', $valueList);
if ($isSet) { // set
return strlen(implode(', ', $valueArr));
} else { // enum
foreach ($valueArr as $value) {
$value = trim($value, "'");
$len = strlen($value);
......@@ -1115,6 +1121,7 @@ class Support {
return $max;
}
}
/**
* Depending on $formMode and $feMode, calculate a new $feMode.
......
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