Fix warnings in PHP 8.0 related to editor components

This commit is contained in:
Kijin Sung 2021-02-09 01:21:53 +09:00
parent c5ceafc841
commit c6f728cec6
4 changed files with 14 additions and 14 deletions

View file

@ -20,7 +20,7 @@ class EditorHandler extends BaseObject
{
Context::set('component_info', $info);
if(!$info->extra_vars)
if(!isset($info->extra_vars) || !$info->extra_vars)
{
return;
}

View file

@ -43,17 +43,17 @@ class image_link extends EditorHandler
*/
function transHTML($xml_obj)
{
$src = $xml_obj->attrs->src;
$width = $xml_obj->attrs->width;
$height = $xml_obj->attrs->height;
$align = $xml_obj->attrs->align;
$alt = $xml_obj->attrs->alt;
$title = $xml_obj->attrs->title;
$border = (int)$xml_obj->attrs->border;
$link_url = $xml_obj->attrs->link_url;
$open_window = $xml_obj->attrs->open_window;
$style = $xml_obj->attrs->style;
$margin = (int)$xml_obj->attrs->margin;
$src = $xml_obj->attrs->src ?? null;
$width = $xml_obj->attrs->width ?? null;
$height = $xml_obj->attrs->height ?? null;
$align = $xml_obj->attrs->align ?? null;
$alt = $xml_obj->attrs->alt ?? null;
$title = $xml_obj->attrs->title ?? null;
$border = intval($xml_obj->attrs->border ?? 0);
$link_url = $xml_obj->attrs->link_url ?? null;
$open_window = $xml_obj->attrs->open_window ?? null;
$style = $xml_obj->attrs->style ?? null;
$margin = intval($xml_obj->attrs->margin ?? 0);
$src = str_replace(array('&','"'), array('&','&qout;'), $src);
$src = str_replace('&', '&', $src);

View file

@ -272,7 +272,7 @@ class editorController extends editor
if(!isset($xml_obj->attrs)) $xml_obj->attrs = new stdClass;
$xml_obj->attrs->{$m[1][$i]} = $m[2][$i];
}
$xml_obj->body = $match[4];
$xml_obj->body = $match[4] ?? null;
if(!$xml_obj->attrs->editor_component) return $match[0];

View file

@ -518,7 +518,7 @@ class editorModel extends editor
return new BaseObject(-1, 'msg_component_is_not_founded', $component);
}
if(!self::$_loaded_component_list[$component][$editor_sequence])
if(!isset(self::$_loaded_component_list[$component][$editor_sequence]))
{
// Create an object of the component and execute
$class_path = sprintf('./modules/editor/components/%s/', $component);