mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
Improve backward compatibility with legacy |@| encoding
This commit is contained in:
parent
460736c04d
commit
d0f0d7205d
1 changed files with 18 additions and 2 deletions
|
|
@ -236,8 +236,22 @@ class Value
|
|||
*/
|
||||
public function validate($value): ?BaseObject
|
||||
{
|
||||
$is_array = is_array($value);
|
||||
$values = is_array($value) ? $value : [$value];
|
||||
// Take legacy encoding into consideration.
|
||||
if (is_array($value))
|
||||
{
|
||||
$is_array = true;
|
||||
$values = $value;
|
||||
}
|
||||
elseif (str_contains($value, '|@|'))
|
||||
{
|
||||
$is_array = true;
|
||||
$values = explode('|@|', $value);
|
||||
}
|
||||
else
|
||||
{
|
||||
$is_array = false;
|
||||
$values = [$value];
|
||||
}
|
||||
|
||||
// Check if a required value is empty.
|
||||
if ($this->is_required === 'Y')
|
||||
|
|
@ -355,10 +369,12 @@ class Value
|
|||
{
|
||||
$values = explode('|@|', $value);
|
||||
}
|
||||
/*
|
||||
elseif (str_contains($value, ',') && $type !== 'kr_zip')
|
||||
{
|
||||
$values = explode(',', $value);
|
||||
}
|
||||
*/
|
||||
else
|
||||
{
|
||||
$values = [$value];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue