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

Merge branch 'F3281-trim-form-input' into 'master'

F3281 - Trim form inputs - refs #3281, closes #3281

See merge request !99
parents 9410c75a 05f4ca25
Pipeline #1020 passed with stage
in 1 minute and 44 seconds
......@@ -2840,6 +2840,9 @@ See also at specific *FormElement* definitions.
| wrapInput | string | |
+------------------------+--------+ |
| wrapNote | string | |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
| trim | string | By default, whitespace is trimmed. To disable, use 'trim=none'. You can also specify custom trim |
| | | characters: 'trim=\\ ' only trims spaces. |
+------------------------+--------+----------------------------------------------------------------------------------------------------------+
......
......@@ -987,6 +987,8 @@ const FE_FILE_AUTO_ORIENT_CMD_DEFAULT = 'convert -auto-orient {{fileDestination:
const FE_FILE_AUTO_ORIENT_MIME_TYPE = 'autoOrientMimeType';
const FE_FILE_CHMOD_FILE = 'chmodFile';
const FE_FILE_CHMOD_DIR = 'chmodDir';
const FE_TRIM = 'trim'; // 'none' | list of characters
const FE_TRIM_NONE = 'none';
// Excel Import
const FE_IMPORT_TO_TABLE = 'importToTable';
......
......@@ -275,6 +275,13 @@ class FillStoreForm {
$val = $clientValues[$clientFieldName];
// Trim input
if (empty($formElement[FE_TRIM])) {
$val = trim($val);
} elseif ($formElement[FE_TRIM] !== FE_TRIM_NONE) {
$val = trim($val, $formElement[FE_TRIM]);
}
switch ($formElement[FE_TYPE]) {
case FE_TYPE_DATE:
case FE_TYPE_DATETIME:
......
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