Bug fixes for emptynull type in ArrayIO, Form\Generate interval

Form\Generate for intervals also allows day(s), month(s), year(s), call
case insensitive

ArrayIO fix for missing escale literal for
date/datetime/interval/emptynull text type
This commit is contained in:
Clemens Schwaighofer
2022-06-22 16:17:16 +09:00
parent 4600f8f7bf
commit a754d897cf
2 changed files with 7 additions and 2 deletions

View File

@@ -471,7 +471,7 @@ class ArrayIO extends \CoreLibs\DB\IO
) {
$_value = 'NULL';
} elseif (isset($this->table_array[$column]['value'])) {
$_value = $this->table_array[$column]['value'];
$_value = $this->dbEscapeLiteral($this->table_array[$column]['value']);
} else {
// fallback
$_value = 'NULL';

View File

@@ -1198,7 +1198,12 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
}
break;
case 'intervalshort': // ony interval n [Y/M/D] only
if (preg_match("/^\d{1,3}\ ?[YMDymd]{1}$/", $this->table_array[$key]['value'])) {
if (
!preg_match(
"/^\d{1,3}\ ?([ymd]{1}|day(s)?|year(s)?|month(s)?)$/i",
$this->table_array[$key]['value']
)
) {
$this->msg .= sprintf(
$this->l->__(
'Please enter a valid time interval in the format '