mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-29 15:22:15 +09:00
Fix #1627 suspected errors in PHP 8.0
This commit is contained in:
parent
7d22aad8d1
commit
05cef078f2
3 changed files with 21 additions and 3 deletions
|
|
@ -3822,7 +3822,7 @@ class memberController extends member
|
|||
{
|
||||
// pass
|
||||
}
|
||||
elseif (!isset($args->{$formInfo->name}) || trim($args->{$formInfo->name} ?? '') === '')
|
||||
elseif (!isset($args->{$formInfo->name}) || $this->_checkEmpty($args->{$formInfo->name} ?? ''))
|
||||
{
|
||||
if (in_array($formInfo->name, $not_required_if_indirect_insert) && !preg_match('/^procMember.+/i', Context::get('act')))
|
||||
{
|
||||
|
|
@ -3918,6 +3918,24 @@ class memberController extends member
|
|||
return new BaseObject;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a variable is empty.
|
||||
*
|
||||
* @param mixed $var
|
||||
* @return bool
|
||||
*/
|
||||
protected function _checkEmpty($var)
|
||||
{
|
||||
if (is_array($var))
|
||||
{
|
||||
return implode('', array_map('trim', $var)) === '';
|
||||
}
|
||||
else
|
||||
{
|
||||
return trim(strval($var)) === '';
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
* @return void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue