Merge remote-tracking branch 'origin/ent-12460-cientos-de-errores-en-el-log-de-apache' into ent-12695-16818-eliminar-warnings-en-console-log

This commit is contained in:
Jonathan 2024-02-07 10:39:47 +01:00
commit 834635a487
50 changed files with 331 additions and 41 deletions

View File

@ -128,6 +128,6 @@ if (empty($data)) {
} }
echo '{ echo '{
"label": "'.htmlspecialchars($graph_title, ENT_QUOTES).'", "label": "'.htmlspecialchars(($graph_title ?? ''), ENT_QUOTES).'",
"data": [["'.time().'", '.htmlspecialchars($data, ENT_QUOTES).']] "data": [["'.time().'", '.htmlspecialchars(($data ?? ''), ENT_QUOTES).']]
}'; }';

View File

@ -150,7 +150,7 @@ if (is_ajax()) {
$component = db_get_row('tlocal_component', 'id', $id_component); $component = db_get_row('tlocal_component', 'id', $id_component);
foreach ($component as $index => $element) { foreach ($component as $index => $element) {
$component[$index] = html_entity_decode( $component[$index] = html_entity_decode(
$element, (isset($element) === true) ? $element : '',
ENT_QUOTES, ENT_QUOTES,
'UTF-8' 'UTF-8'
); );

View File

@ -505,7 +505,7 @@ $tableBasicThresholds->data['caption_switch_warning_inverse_string'][0] = html_p
$tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>'; $tableBasicThresholds->data['caption_warning_threshold'][0] .= '<span class="font_11" id="caption_str_warning">('.__('Str.').')</span>';
$tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text( $tableBasicThresholds->data['warning_threshold'][0] .= html_print_input_text(
'str_warning', 'str_warning',
str_replace('"', '', $str_warning), str_replace('"', '', (isset($str_warning) === true) ? $str_warning : ''),
'', '',
10, 10,
1024, 1024,
@ -602,7 +602,7 @@ $tableBasicThresholds->data['switch_critical_threshold'][0] .= html_print_div(
$tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>'; $tableBasicThresholds->data['caption_critical_threshold'][0] .= '<span class="font_11" id="caption_str_critical">('.__('Str.').')</span>';
$tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text( $tableBasicThresholds->data['critical_threshold'][0] .= html_print_input_text(
'str_critical', 'str_critical',
str_replace('"', '', $str_critical), str_replace('"', '', (isset($str_critical) === true) ? $str_critical : ''),
'', '',
10, 10,
1024, 1024,

View File

@ -60,7 +60,12 @@ $data[1] = html_print_select_from_sql(
$disabledBecauseInPolicy $disabledBecauseInPolicy
); );
// Store the macros in base64 into a hidden control to move between pages // Store the macros in base64 into a hidden control to move between pages
$data[1] .= html_print_input_hidden('macros', base64_encode($macros), true); $data[1] .= html_print_input_hidden(
'macros',
(isset($macros) === true) ? base64_encode($macros) : '',
true
);
$table_simple->colspan['plugin_1'][2] = 2; $table_simple->colspan['plugin_1'][2] = 2;
if (!empty($id_plugin)) { if (!empty($id_plugin)) {

View File

@ -1500,7 +1500,7 @@ $table->data[39][0] = html_print_label_input_block(
'', '',
'', '',
true true
).html_print_input_hidden('macros', base64_encode($macros), true) ).html_print_input_hidden('macros', base64_encode(($macros ?? '')), true)
); );
require_once $config['homedir'].'/include/class/CredentialStore.class.php'; require_once $config['homedir'].'/include/class/CredentialStore.class.php';

View File

@ -386,7 +386,7 @@ if (empty($result) === false) {
$data[4] = $output; $data[4] = $output;
$phone_large = io_safe_output($tag['phone']); $phone_large = io_safe_output($tag['phone']);
$phone_small = substr($phone_large, 0, 24); $phone_small = substr(($phone_large ?? ''), 0, 24);
if ($phone_large == $phone_small) { if ($phone_large == $phone_small) {
$output = $phone_large; $output = $phone_large;
} else { } else {

View File

@ -37,6 +37,20 @@ class Applications extends Wizard
*/ */
public $mode; public $mode;
/**
* Task properties.
*
* @var array
*/
public $task;
/**
* Class of styles.
*
* @var string
*/
public $class;
/** /**
* Constructor. * Constructor.

View File

@ -37,6 +37,20 @@ class Custom extends Wizard
*/ */
public $mode; public $mode;
/**
* Task properties.
*
* @var array
*/
public $task;
/**
* Class of styles.
*
* @var string
*/
public $class;
/** /**
* Constructor. * Constructor.

View File

@ -47,6 +47,13 @@ ui_require_javascript_file('simTree');
class DiscoveryTaskList extends HTML class DiscoveryTaskList extends HTML
{ {
/**
* Task properties.
*
* @var array
*/
public $task;
/** /**
* Constructor. * Constructor.

View File

@ -1109,7 +1109,7 @@ class HostDevices extends Wizard
'return' => true, 'return' => true,
'selected' => explode( 'selected' => explode(
',', ',',
$this->task['id_network_profile'] (isset($this->task['id_network_profile']) === true) ? $this->task['id_network_profile'] : ''
), ),
'nothing_value' => 0, 'nothing_value' => 0,
'nothing' => __('None'), 'nothing' => __('None'),

View File

@ -97,6 +97,13 @@ class Wizard
*/ */
public $access = 'AR'; public $access = 'AR';
/**
* Root url.
*
* @var string
*/
public $rootUrl;
/** /**
* Setter for breadcrum * Setter for breadcrum
@ -550,7 +557,7 @@ class Wizard
} }
echo '<ul class="bigbuttonlist">'; echo '<ul class="bigbuttonlist">';
array_map('self::printBigButtonElement', $list_data); array_map(['Wizard', 'printBigButtonElement'], $list_data);
echo '</ul>'; echo '</ul>';
if ($return === true) { if ($return === true) {

View File

@ -250,6 +250,7 @@ if (is_ajax() === true) {
if ($getInfo === true) { if ($getInfo === true) {
enterprise_include_once('include/functions_agents.php'); enterprise_include_once('include/functions_agents.php');
include_once $config['homedir'].'/include/functions_graph.php';
$id = get_parameter('id', 0); $id = get_parameter('id', 0);
$id_server = get_parameter('id_server', 0); $id_server = get_parameter('id_server', 0);
if (empty($id_server) === false) { if (empty($id_server) === false) {

View File

@ -380,5 +380,7 @@ if (session_status() !== PHP_SESSION_DISABLED) {
// Could give a warning if no session file is created. Ignore. // Could give a warning if no session file is created. Ignore.
@session_destroy(); @session_destroy();
header_remove('Set-Cookie'); header_remove('Set-Cookie');
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); if (isset($_COOKIE[session_name()]) === true) {
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/');
}
} }

View File

@ -575,7 +575,7 @@ function get_user_info($user)
function get_users($order='fullname', $filter=false, $fields=false) function get_users($order='fullname', $filter=false, $fields=false)
{ {
if (is_array($order) === true) { if (is_array($order) === true) {
$filter['order'] = $order['field'].' '.$order['order']; $filter['order'] = (string) $order['field'].' '.(string) $order['order'];
} else { } else {
if ($order !== 'registered' || $order !== 'last_connect' || $order !== 'fullname') { if ($order !== 'registered' || $order !== 'last_connect' || $order !== 'fullname') {
$order = 'fullname'; $order = 'fullname';

View File

@ -53,6 +53,48 @@ class AuditLog extends HTML
*/ */
private $ajaxController; private $ajaxController;
/**
* TableId
*
* @var integer
*/
public $tableId;
/**
* FilterIp
*
* @var array
*/
public $filterIp;
/**
* FilterPeriod
*
* @var integer
*/
public $filterPeriod;
/**
* FilterText
*
* @var string
*/
public $filterText;
/**
* FilterType
*
* @var string
*/
public $filterType;
/**
* FilterUser
*
* @var string
*/
public $filterUser;
/** /**
* Class constructor * Class constructor

View File

@ -66,6 +66,13 @@ class CalendarManager
*/ */
private $message; private $message;
/**
* Access
*
* @var string
*/
public $access;
/** /**
* Allowed methods to be called using AJAX request. * Allowed methods to be called using AJAX request.
* *

View File

@ -850,7 +850,7 @@ class CredentialStore extends Wizard
'privilege' => 'AR', 'privilege' => 'AR',
'type' => 'select_groups', 'type' => 'select_groups',
'nothing' => false, 'nothing' => false,
'selected' => (defined($id_group_filter) ? $id_group_filter : 0), 'selected' => ((isset($id_group_filter) === true) ? $id_group_filter : 0),
'return' => true, 'return' => true,
'size' => '80%', 'size' => '80%',
], ],

View File

@ -54,6 +54,13 @@ class Diagnostics extends Wizard
*/ */
public $pdf; public $pdf;
/**
* Product name.
*
* @var string
*/
public $product_name;
/** /**
* Constructor. * Constructor.

View File

@ -38,6 +38,62 @@ require_once $config['homedir'].'/include/class/HTML.class.php';
class ExternalTools extends HTML class ExternalTools extends HTML
{ {
/**
* Origin
*
* @var string
*/
public $origin;
/**
* PathCustomComm
*
* @var string
*/
public $pathCustomComm;
/**
* PathDig
*
* @var string
*/
public $pathDig;
/**
* PathNmap
*
* @var string
*/
public $pathNmap;
/**
* PathPing
*
* @var string
*/
public $pathPing;
/**
* PathSnmpget
*
* @var string
*/
public $pathSnmpget;
/**
* PathTraceroute
*
* @var string
*/
public $pathTraceroute;
/**
* UpdatePaths
*
* @var string
*/
public $updatePaths;
/** /**
* Constructor. * Constructor.

View File

@ -706,7 +706,7 @@ class NetworkMap
*/ */
public function setNodes($nodes) public function setNodes($nodes)
{ {
$this->nodes = $nodes; $this->nodes = (array) $nodes;
} }

View File

@ -52,6 +52,13 @@ class OrderInterpreter extends Wizard
*/ */
public $ajaxController; public $ajaxController;
/**
* Pages menu
*
* @var array
*/
public $pages_menu;
/** /**
* Generates a JSON error. * Generates a JSON error.

View File

@ -67,6 +67,34 @@ class SatelliteAgent extends HTML
*/ */
private $ajaxController; private $ajaxController;
/**
* Satellite_name
*
* @var string
*/
public $satellite_name;
/**
* Satellite_server
*
* @var string
*/
public $satellite_server;
/**
* TableId
*
* @var integer
*/
public $tableId;
/**
* Satellite_config
*
* @var string
*/
public $satellite_config;
/** /**
* Class constructor * Class constructor

View File

@ -2917,6 +2917,10 @@ function delete_dir($dir)
*/ */
function is_image_data($data) function is_image_data($data)
{ {
if (isset($data) === false) {
return false;
}
return (substr($data, 0, 10) == 'data:image'); return (substr($data, 0, 10) == 'data:image');
} }
@ -2939,7 +2943,7 @@ function is_snapshot_data($data)
*/ */
function is_text_to_black_string($data) function is_text_to_black_string($data)
{ {
if (is_image_data($data)) { if (isset($data) === false || is_image_data($data)) {
return false; return false;
} }

View File

@ -541,7 +541,7 @@ function api_get_groups($thrash1, $thrash2, $other, $returnType, $user_in_db)
} }
function api_get_agent_module_name_last_value($agentName, $moduleName, $other=';', $returnType) function api_get_agent_module_name_last_value($agentName, $moduleName, $other=';', $returnType='string')
{ {
$idAgent = agents_get_agent_id($agentName); $idAgent = agents_get_agent_id($agentName);
@ -558,7 +558,7 @@ function api_get_agent_module_name_last_value($agentName, $moduleName, $other=';
} }
function api_get_agent_module_name_last_value_alias($alias, $moduleName, $other=';', $returnType) function api_get_agent_module_name_last_value_alias($alias, $moduleName, $other=';', $returnType='string')
{ {
$sql = sprintf( $sql = sprintf(
'SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo 'SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo
@ -573,7 +573,7 @@ function api_get_agent_module_name_last_value_alias($alias, $moduleName, $other=
} }
function api_get_module_last_value($idAgentModule, $trash1, $other=';', $returnType) function api_get_module_last_value($idAgentModule, $trash1, $other=';', $returnType='string')
{ {
global $config; global $config;
if (defined('METACONSOLE')) { if (defined('METACONSOLE')) {

View File

@ -440,7 +440,7 @@ function extensions_add_operation_menu_option($name, $fatherId=null, $icon=null,
$option_menu['acl'] = $acl; $option_menu['acl'] = $acl;
$extension = &$config['extensions'][$extension_file]; $extension = &$config['extensions'][$extension_file];
$option_menu['sec2'] = $extension['dir'].'/'.mb_substr($extension_file, 0, -4); $option_menu['sec2'] = $extension['dir'].'/'.mb_substr(($extension_file ?? ''), 0, -4);
$option_menu['fatherId'] = $fatherId; $option_menu['fatherId'] = $fatherId;
$option_menu['subfatherId'] = $subfatherId; $option_menu['subfatherId'] = $subfatherId;
$option_menu['icon'] = $icon; $option_menu['icon'] = $icon;

View File

@ -100,7 +100,7 @@ function forecast_projection_graph(
$data[0] = ''; $data[0] = '';
$data[1] = $cont; $data[1] = $cont;
$data[2] = date($config['date_format'], $row[0]); $data[2] = date($config['date_format'], (int) $row[0]);
$data[3] = $row[0]; $data[3] = $row[0];
$data[4] = $row[1]; $data[4] = $row[1];
$data[5] = ($row[0] * $row[1]); $data[5] = ($row[0] * $row[1]);

View File

@ -561,10 +561,8 @@ function io_output_password($password, $wrappedBy='')
] ]
); );
$output = ($plaintext === ENTERPRISE_NOT_HOOK) ? $password : $plaintext;
// If password already decrypt return same password. // If password already decrypt return same password.
$output = (empty($plaintext) === true) ? $password : $plaintext; $output = (empty($plaintext) === true || $plaintext === ENTERPRISE_NOT_HOOK) ? $password : $plaintext;
return sprintf( return sprintf(
'%s%s%s', '%s%s%s',

View File

@ -819,7 +819,7 @@ function notifications_print_global_source_configuration($source)
$html_checkboxes = ''; $html_checkboxes = '';
$blacklist = json_decode($source['subtype_blacklist'], 1); $blacklist = json_decode(($source['subtype_blacklist'] ?? ''), 1);
if (json_last_error() !== JSON_ERROR_NONE) { if (json_last_error() !== JSON_ERROR_NONE) {
$blacklist = []; $blacklist = [];
} }

View File

@ -243,6 +243,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
$profile = json_decode($profile); $profile = json_decode($profile);
} }
$result = [];
$result[] = [ $result[] = [
'id_grupo' => $profile->group, 'id_grupo' => $profile->group,
'id_perfil' => $profile->profile, 'id_perfil' => $profile->profile,

View File

@ -1039,7 +1039,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
echo " echo "
<script> <script>
function sendHash(url) { function sendHash(url) {
window.open(url+'&loginhash=auto&loginhash_data=".$hashdata.'&loginhash_user='.str_rot13($user)."', '_blank'); window.open(url+'&loginhash=auto&loginhash_data=".$hashdata.'&loginhash_user='.str_rot13(($user ?? ''))."', '_blank');
} }

View File

@ -148,7 +148,7 @@ function ui_print_truncate_text(
$text_html_decoded = io_safe_output($text); $text_html_decoded = io_safe_output($text);
$text_has_entities = $text != $text_html_decoded; $text_has_entities = $text != $text_html_decoded;
if (mb_strlen($text_html_decoded, 'UTF-8') > ($numChars)) { if (isset($text_html_decoded) === true && mb_strlen($text_html_decoded, 'UTF-8') > ($numChars)) {
// '/2' because [...] is in the middle of the word. // '/2' because [...] is in the middle of the word.
$half_length = intval(($numChars - 3) / 2); $half_length = intval(($numChars - 3) / 2);

View File

@ -301,6 +301,13 @@ function gd_progress_bubble($width, $height, $progress, $title, $font, $out_of_l
function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color) function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color)
{ {
$x1 = (int) $x1;
$y1 = (int) $y1;
$x2 = (int) $x2;
$y2 = (int) $y2;
$radius = (int) $radius;
$color = (int) $color;
// Draw rectangle without corners // Draw rectangle without corners
imagefilledrectangle($im, ($x1 + $radius), $y1, ($x2 - $radius), $y2, $color); imagefilledrectangle($im, ($x1 + $radius), $y1, ($x2 - $radius), $y2, $color);
imagefilledrectangle($im, $x1, ($y1 + $radius), $x2, ($y2 - $radius), $color); imagefilledrectangle($im, $x1, ($y1 + $radius), $x2, ($y2 - $radius), $color);

View File

@ -113,6 +113,13 @@ class ClusterWizard extends \HTML
*/ */
private $agent; private $agent;
/**
* Id of clusters.
*
* @var integer
*/
public $id;
/** /**
* Builds a Cluster Wizard. * Builds a Cluster Wizard.

View File

@ -167,6 +167,20 @@ class Manager implements PublicLogin
*/ */
private $duplicateCellId; private $duplicateCellId;
/**
* Url
*
* @var string
*/
public $url;
/**
* Widget
*
* @var Widget
*/
public $cWidget;
/** /**
* Allowed methods to be called using AJAX request. * Allowed methods to be called using AJAX request.
* *

View File

@ -65,6 +65,27 @@ class Widget
*/ */
private $dateTo; private $dateTo;
/**
* Data cell
*
* @var array
*/
public $dataCell;
/**
* Overflow scrollbar.
*
* @var boolean
*/
public $overflow_scrollbars;
/**
* Position
*
* @var array
*/
public $position;
/** /**
* Contructor widget. * Contructor widget.

View File

@ -226,7 +226,7 @@ class AgentHive extends Widget
'name' => 'groups[]', 'name' => 'groups[]',
'returnAllGroup' => false, 'returnAllGroup' => false,
'privilege' => 'AR', 'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]), 'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'required' => true, 'required' => true,

View File

@ -117,6 +117,13 @@ class DataMatrix extends Widget
*/ */
protected $cellId; protected $cellId;
/**
* Position
*
* @var array
*/
public $size;
/** /**
* Construct. * Construct.

View File

@ -115,6 +115,13 @@ class ModulesByStatus extends Widget
*/ */
protected $cellId; protected $cellId;
/**
* Size
*
* @var array
*/
public $size;
/** /**
* Construct. * Construct.

View File

@ -355,7 +355,7 @@ class AgentModuleWidget extends Widget
*/ */
public function getIdCacheAgent($id_agents) public function getIdCacheAgent($id_agents)
{ {
$target_agents = explode(',', $id_agents); $target_agents = explode(',', ($id_agents ?? ''));
$cache_id_agents = []; $cache_id_agents = [];
foreach ($target_agents as $agent_id) { foreach ($target_agents as $agent_id) {
if (str_contains($agent_id, '|') === false) { if (str_contains($agent_id, '|') === false) {

View File

@ -111,6 +111,20 @@ class EventsListWidget extends Widget
*/ */
protected $publicLink; protected $publicLink;
/**
* Overflow scrollbar.
*
* @var boolean
*/
public $overflow_scrollbars;
/**
* Position
*
* @var array
*/
public $position;
/** /**
* Construct. * Construct.

View File

@ -271,7 +271,7 @@ class HeatmapWidget extends Widget
'name' => 'groups[]', 'name' => 'groups[]',
'returnAllGroup' => true, 'returnAllGroup' => true,
'privilege' => 'AR', 'privilege' => 'AR',
'selected' => explode(',', $values['groups'][0]), 'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
], ],
@ -305,7 +305,7 @@ class HeatmapWidget extends Widget
'type' => 'select', 'type' => 'select',
'fields' => $tags, 'fields' => $tags,
'name' => 'tags[]', 'name' => 'tags[]',
'selected' => explode(',', $values['tags'][0]), 'selected' => (isset($values['tags'][0]) === true) ? explode(',', $values['tags'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
], ],
@ -332,7 +332,7 @@ class HeatmapWidget extends Widget
'type' => 'select', 'type' => 'select',
'fields' => $module_groups, 'fields' => $module_groups,
'name' => 'module_groups[]', 'name' => 'module_groups[]',
'selected' => explode(',', $values['module_groups'][0]), 'selected' => (isset($values['module_groups'][0]) === true) ? explode(',', $values['module_groups'][0]) : [],
'return' => true, 'return' => true,
'multiple' => true, 'multiple' => true,
'nothing' => __('Not assigned'), 'nothing' => __('Not assigned'),

View File

@ -446,7 +446,7 @@ class SecurityHardening extends Widget
{ {
global $config; global $config;
$id_groups = explode(',', $group); $id_groups = explode(',', ($group ?? ''));
if (in_array(0, $id_groups) === true) { if (in_array(0, $id_groups) === true) {
$id_groups = array_keys(users_get_groups($config['id_user'], 'AR', false)); $id_groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
} }

View File

@ -83,7 +83,11 @@ class SnmpTraps extends Element
{ {
if ($this->isEnabled() === true) { if ($this->isEnabled() === true) {
$value = $this->valueMonitoring('snmp_trap_queue'); $value = $this->valueMonitoring('snmp_trap_queue');
$total = round($value[0]['data']); if (isset($value[0]['data']) === true) {
$total = round($value[0]['data']);
} else {
$total = __('N/A');
}
} else { } else {
$total = __('N/A'); $total = __('N/A');
} }
@ -109,7 +113,11 @@ class SnmpTraps extends Element
{ {
if ($this->isEnabled() === true) { if ($this->isEnabled() === true) {
$value = $this->valueMonitoring('total_trap'); $value = $this->valueMonitoring('total_trap');
$total = round($value[0]['data']); if (isset($value[0]['data']) === true) {
$total = round($value[0]['data']);
} else {
$total = __('N/A');
}
} else { } else {
$total = __('N/A'); $total = __('N/A');
} }

View File

@ -505,7 +505,7 @@ if (is_ajax() === true) {
} }
} }
if (strlen($tmp->server_name) >= 10) { if (isset($tmp->server_name) === true && strlen($tmp->server_name) >= 10) {
$tmp->server_name = ui_print_truncate_text( $tmp->server_name = ui_print_truncate_text(
$tmp->server_name, $tmp->server_name,
10, 10,

View File

@ -382,7 +382,7 @@ ui_print_standard_header(
$inventory_id_agent = (int) get_parameter('agent_id', -1); $inventory_id_agent = (int) get_parameter('agent_id', -1);
$inventory_agent = (string) get_parameter('agent', ''); $inventory_agent = (string) get_parameter('agent', '');
if (strlen($inventory_agent) == 0) { if (strlen(($inventory_agent ?? '')) == 0) {
$inventory_id_agent = -1; $inventory_id_agent = -1;
$inventory_agent = __('All'); $inventory_agent = __('All');
} else if ($inventory_agent == __('All')) { } else if ($inventory_agent == __('All')) {

View File

@ -123,7 +123,7 @@ class Manager
string $public_url, string $public_url,
?string $ajax_url=null, ?string $ajax_url=null,
?string $page=null, ?string $page=null,
array $settings, array $settings=[],
?int $mode=null, ?int $mode=null,
bool $composer=false bool $composer=false
) { ) {

View File

@ -15,7 +15,7 @@ trait JsonSerializable
/** /**
* @return array * @return array
*/ */
public function jsonSerialize() public function jsonSerialize():mixed
{ {
return array_map(function ($value) { return array_map(function ($value) {
if ($value instanceof JsonSerializableInterface) { if ($value instanceof JsonSerializableInterface) {

View File

@ -148,7 +148,7 @@ class Elements implements ArraySerializableInterface, JsonSerializable
/** /**
* @return array * @return array
*/ */
public function jsonSerialize() public function jsonSerialize():mixed
{ {
return $this->getArrayCopy(); return $this->getArrayCopy();
} }

View File

@ -34,7 +34,12 @@ if ($redraw === false) {
$output .= '<div class="header-widget">'; $output .= '<div class="header-widget">';
$output .= '<div>'; $output .= '<div>';
$options = json_decode($cellData['options'], true); if (isset($cellData['options']) === true) {
$options = json_decode($cellData['options'], true);
} else {
$options = [];
}
if ($cellData['id_widget'] !== '0') { if ($cellData['id_widget'] !== '0') {
$output .= $options['title']; $output .= $options['title'];
} else { } else {

View File

@ -43,7 +43,7 @@ $form = [
'extra' => 'novalidate', 'extra' => 'novalidate',
]; ];
$js = 'tinymce.init({ $js .= ' tinymce.init({
selector: "#textarea_text", selector: "#textarea_text",
plugins: "preview, searchreplace, table, nonbreaking, link, image", plugins: "preview, searchreplace, table, nonbreaking, link, image",
promotion: false, promotion: false,