Fix deprecation notices in PHP 8.2 #2064

This commit is contained in:
Kijin Sung 2023-01-16 21:24:59 +09:00
parent 8e2c4b3ef9
commit c07efe7905
7 changed files with 15 additions and 14 deletions

View file

@ -1686,7 +1686,7 @@ class Context
for($i = 0; $i < $num_args; $i += 2)
{
$key = $args_list[$i];
$val = trim($args_list[$i + 1]);
$val = trim($args_list[$i + 1] ?? '');
if ($val === '')
{
unset($get_vars[$key]);

View file

@ -107,7 +107,8 @@ class HTMLDisplayHandler
'dispPageAdminMobileContentModify' => true,
'dispPageAdminMobileContent' => true,
);
if(Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && !isset($x_exclude_actions[Context::get('act')]))
$current_act = Context::get('act') ?? '';
if(Context::get('module') != 'admin' && strpos($current_act, 'Admin') !== false && !isset($x_exclude_actions[$current_act]))
{
$output = '<div class="x">' . $output . '</div>';
}

View file

@ -1109,7 +1109,7 @@ class ModuleHandler extends Handler
{
if($val->type == 'image')
{
if(strncmp('./files/attach/images/', $val->value, 22) === 0)
if(strncmp('./files/attach/images/', $val->value ?? '', 22) === 0)
{
$val->value = Context::getRequestUri() . substr($val->value, 2);
}

View file

@ -100,7 +100,7 @@ class PageHandler extends Handler implements Iterator
*
* @return void
*/
public function rewind()
public function rewind(): void
{
$this->point = 0;
}
@ -141,7 +141,7 @@ class PageHandler extends Handler implements Iterator
*
* @return void
*/
public function next()
public function next(): void
{
$this->point++;
}