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:
commit
834635a487
|
@ -128,6 +128,6 @@ if (empty($data)) {
|
|||
}
|
||||
|
||||
echo '{
|
||||
"label": "'.htmlspecialchars($graph_title, ENT_QUOTES).'",
|
||||
"data": [["'.time().'", '.htmlspecialchars($data, ENT_QUOTES).']]
|
||||
"label": "'.htmlspecialchars(($graph_title ?? ''), ENT_QUOTES).'",
|
||||
"data": [["'.time().'", '.htmlspecialchars(($data ?? ''), ENT_QUOTES).']]
|
||||
}';
|
||||
|
|
|
@ -150,7 +150,7 @@ if (is_ajax()) {
|
|||
$component = db_get_row('tlocal_component', 'id', $id_component);
|
||||
foreach ($component as $index => $element) {
|
||||
$component[$index] = html_entity_decode(
|
||||
$element,
|
||||
(isset($element) === true) ? $element : '',
|
||||
ENT_QUOTES,
|
||||
'UTF-8'
|
||||
);
|
||||
|
|
|
@ -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['warning_threshold'][0] .= html_print_input_text(
|
||||
'str_warning',
|
||||
str_replace('"', '', $str_warning),
|
||||
str_replace('"', '', (isset($str_warning) === true) ? $str_warning : ''),
|
||||
'',
|
||||
10,
|
||||
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['critical_threshold'][0] .= html_print_input_text(
|
||||
'str_critical',
|
||||
str_replace('"', '', $str_critical),
|
||||
str_replace('"', '', (isset($str_critical) === true) ? $str_critical : ''),
|
||||
'',
|
||||
10,
|
||||
1024,
|
||||
|
|
|
@ -60,7 +60,12 @@ $data[1] = html_print_select_from_sql(
|
|||
$disabledBecauseInPolicy
|
||||
);
|
||||
// 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;
|
||||
|
||||
if (!empty($id_plugin)) {
|
||||
|
|
|
@ -1500,7 +1500,7 @@ $table->data[39][0] = html_print_label_input_block(
|
|||
'',
|
||||
'',
|
||||
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';
|
||||
|
|
|
@ -386,7 +386,7 @@ if (empty($result) === false) {
|
|||
$data[4] = $output;
|
||||
|
||||
$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) {
|
||||
$output = $phone_large;
|
||||
} else {
|
||||
|
|
|
@ -37,6 +37,20 @@ class Applications extends Wizard
|
|||
*/
|
||||
public $mode;
|
||||
|
||||
/**
|
||||
* Task properties.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $task;
|
||||
|
||||
/**
|
||||
* Class of styles.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $class;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
@ -37,6 +37,20 @@ class Custom extends Wizard
|
|||
*/
|
||||
public $mode;
|
||||
|
||||
/**
|
||||
* Task properties.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $task;
|
||||
|
||||
/**
|
||||
* Class of styles.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $class;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
@ -47,6 +47,13 @@ ui_require_javascript_file('simTree');
|
|||
class DiscoveryTaskList extends HTML
|
||||
{
|
||||
|
||||
/**
|
||||
* Task properties.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $task;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
@ -1109,7 +1109,7 @@ class HostDevices extends Wizard
|
|||
'return' => true,
|
||||
'selected' => explode(
|
||||
',',
|
||||
$this->task['id_network_profile']
|
||||
(isset($this->task['id_network_profile']) === true) ? $this->task['id_network_profile'] : ''
|
||||
),
|
||||
'nothing_value' => 0,
|
||||
'nothing' => __('None'),
|
||||
|
|
|
@ -97,6 +97,13 @@ class Wizard
|
|||
*/
|
||||
public $access = 'AR';
|
||||
|
||||
/**
|
||||
* Root url.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $rootUrl;
|
||||
|
||||
|
||||
/**
|
||||
* Setter for breadcrum
|
||||
|
@ -550,7 +557,7 @@ class Wizard
|
|||
}
|
||||
|
||||
echo '<ul class="bigbuttonlist">';
|
||||
array_map('self::printBigButtonElement', $list_data);
|
||||
array_map(['Wizard', 'printBigButtonElement'], $list_data);
|
||||
echo '</ul>';
|
||||
|
||||
if ($return === true) {
|
||||
|
|
|
@ -250,6 +250,7 @@ if (is_ajax() === true) {
|
|||
|
||||
if ($getInfo === true) {
|
||||
enterprise_include_once('include/functions_agents.php');
|
||||
include_once $config['homedir'].'/include/functions_graph.php';
|
||||
$id = get_parameter('id', 0);
|
||||
$id_server = get_parameter('id_server', 0);
|
||||
if (empty($id_server) === false) {
|
||||
|
|
|
@ -380,5 +380,7 @@ if (session_status() !== PHP_SESSION_DISABLED) {
|
|||
// Could give a warning if no session file is created. Ignore.
|
||||
@session_destroy();
|
||||
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), '/');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -575,7 +575,7 @@ function get_user_info($user)
|
|||
function get_users($order='fullname', $filter=false, $fields=false)
|
||||
{
|
||||
if (is_array($order) === true) {
|
||||
$filter['order'] = $order['field'].' '.$order['order'];
|
||||
$filter['order'] = (string) $order['field'].' '.(string) $order['order'];
|
||||
} else {
|
||||
if ($order !== 'registered' || $order !== 'last_connect' || $order !== 'fullname') {
|
||||
$order = 'fullname';
|
||||
|
|
|
@ -53,6 +53,48 @@ class AuditLog extends HTML
|
|||
*/
|
||||
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
|
||||
|
|
|
@ -66,6 +66,13 @@ class CalendarManager
|
|||
*/
|
||||
private $message;
|
||||
|
||||
/**
|
||||
* Access
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $access;
|
||||
|
||||
/**
|
||||
* Allowed methods to be called using AJAX request.
|
||||
*
|
||||
|
|
|
@ -850,7 +850,7 @@ class CredentialStore extends Wizard
|
|||
'privilege' => 'AR',
|
||||
'type' => 'select_groups',
|
||||
'nothing' => false,
|
||||
'selected' => (defined($id_group_filter) ? $id_group_filter : 0),
|
||||
'selected' => ((isset($id_group_filter) === true) ? $id_group_filter : 0),
|
||||
'return' => true,
|
||||
'size' => '80%',
|
||||
],
|
||||
|
|
|
@ -54,6 +54,13 @@ class Diagnostics extends Wizard
|
|||
*/
|
||||
public $pdf;
|
||||
|
||||
/**
|
||||
* Product name.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $product_name;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
@ -38,6 +38,62 @@ require_once $config['homedir'].'/include/class/HTML.class.php';
|
|||
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.
|
||||
|
|
|
@ -706,7 +706,7 @@ class NetworkMap
|
|||
*/
|
||||
public function setNodes($nodes)
|
||||
{
|
||||
$this->nodes = $nodes;
|
||||
$this->nodes = (array) $nodes;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,13 @@ class OrderInterpreter extends Wizard
|
|||
*/
|
||||
public $ajaxController;
|
||||
|
||||
/**
|
||||
* Pages menu
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $pages_menu;
|
||||
|
||||
|
||||
/**
|
||||
* Generates a JSON error.
|
||||
|
|
|
@ -67,6 +67,34 @@ class SatelliteAgent extends HTML
|
|||
*/
|
||||
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
|
||||
|
|
|
@ -2917,6 +2917,10 @@ function delete_dir($dir)
|
|||
*/
|
||||
function is_image_data($data)
|
||||
{
|
||||
if (isset($data) === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return (substr($data, 0, 10) == 'data:image');
|
||||
}
|
||||
|
||||
|
@ -2939,7 +2943,7 @@ function is_snapshot_data($data)
|
|||
*/
|
||||
function is_text_to_black_string($data)
|
||||
{
|
||||
if (is_image_data($data)) {
|
||||
if (isset($data) === false || is_image_data($data)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
@ -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(
|
||||
'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;
|
||||
if (defined('METACONSOLE')) {
|
||||
|
|
|
@ -440,7 +440,7 @@ function extensions_add_operation_menu_option($name, $fatherId=null, $icon=null,
|
|||
$option_menu['acl'] = $acl;
|
||||
$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['subfatherId'] = $subfatherId;
|
||||
$option_menu['icon'] = $icon;
|
||||
|
|
|
@ -100,7 +100,7 @@ function forecast_projection_graph(
|
|||
|
||||
$data[0] = '';
|
||||
$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[4] = $row[1];
|
||||
$data[5] = ($row[0] * $row[1]);
|
||||
|
|
|
@ -561,10 +561,8 @@ function io_output_password($password, $wrappedBy='')
|
|||
]
|
||||
);
|
||||
|
||||
$output = ($plaintext === ENTERPRISE_NOT_HOOK) ? $password : $plaintext;
|
||||
|
||||
// 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(
|
||||
'%s%s%s',
|
||||
|
|
|
@ -819,7 +819,7 @@ function notifications_print_global_source_configuration($source)
|
|||
|
||||
$html_checkboxes = '';
|
||||
|
||||
$blacklist = json_decode($source['subtype_blacklist'], 1);
|
||||
$blacklist = json_decode(($source['subtype_blacklist'] ?? ''), 1);
|
||||
if (json_last_error() !== JSON_ERROR_NONE) {
|
||||
$blacklist = [];
|
||||
}
|
||||
|
|
|
@ -243,6 +243,7 @@ function profile_print_profile_table($id, $json_profile=false, $return=false, $c
|
|||
$profile = json_decode($profile);
|
||||
}
|
||||
|
||||
$result = [];
|
||||
$result[] = [
|
||||
'id_grupo' => $profile->group,
|
||||
'id_perfil' => $profile->profile,
|
||||
|
|
|
@ -1039,7 +1039,7 @@ function treeview_printTable($id_agente, $server_data=[], $no_head=false)
|
|||
echo "
|
||||
<script>
|
||||
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');
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ function ui_print_truncate_text(
|
|||
$text_html_decoded = io_safe_output($text);
|
||||
$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.
|
||||
$half_length = intval(($numChars - 3) / 2);
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
$x1 = (int) $x1;
|
||||
$y1 = (int) $y1;
|
||||
$x2 = (int) $x2;
|
||||
$y2 = (int) $y2;
|
||||
$radius = (int) $radius;
|
||||
$color = (int) $color;
|
||||
|
||||
// Draw rectangle without corners
|
||||
imagefilledrectangle($im, ($x1 + $radius), $y1, ($x2 - $radius), $y2, $color);
|
||||
imagefilledrectangle($im, $x1, ($y1 + $radius), $x2, ($y2 - $radius), $color);
|
||||
|
|
|
@ -113,6 +113,13 @@ class ClusterWizard extends \HTML
|
|||
*/
|
||||
private $agent;
|
||||
|
||||
/**
|
||||
* Id of clusters.
|
||||
*
|
||||
* @var integer
|
||||
*/
|
||||
public $id;
|
||||
|
||||
|
||||
/**
|
||||
* Builds a Cluster Wizard.
|
||||
|
|
|
@ -167,6 +167,20 @@ class Manager implements PublicLogin
|
|||
*/
|
||||
private $duplicateCellId;
|
||||
|
||||
/**
|
||||
* Url
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $url;
|
||||
|
||||
/**
|
||||
* Widget
|
||||
*
|
||||
* @var Widget
|
||||
*/
|
||||
public $cWidget;
|
||||
|
||||
/**
|
||||
* Allowed methods to be called using AJAX request.
|
||||
*
|
||||
|
|
|
@ -65,6 +65,27 @@ class Widget
|
|||
*/
|
||||
private $dateTo;
|
||||
|
||||
/**
|
||||
* Data cell
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $dataCell;
|
||||
|
||||
/**
|
||||
* Overflow scrollbar.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $overflow_scrollbars;
|
||||
|
||||
/**
|
||||
* Position
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $position;
|
||||
|
||||
|
||||
/**
|
||||
* Contructor widget.
|
||||
|
|
|
@ -226,7 +226,7 @@ class AgentHive extends Widget
|
|||
'name' => 'groups[]',
|
||||
'returnAllGroup' => false,
|
||||
'privilege' => 'AR',
|
||||
'selected' => explode(',', $values['groups'][0]),
|
||||
'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
'required' => true,
|
||||
|
|
|
@ -117,6 +117,13 @@ class DataMatrix extends Widget
|
|||
*/
|
||||
protected $cellId;
|
||||
|
||||
/**
|
||||
* Position
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $size;
|
||||
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
|
|
|
@ -115,6 +115,13 @@ class ModulesByStatus extends Widget
|
|||
*/
|
||||
protected $cellId;
|
||||
|
||||
/**
|
||||
* Size
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $size;
|
||||
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
|
|
|
@ -355,7 +355,7 @@ class AgentModuleWidget extends Widget
|
|||
*/
|
||||
public function getIdCacheAgent($id_agents)
|
||||
{
|
||||
$target_agents = explode(',', $id_agents);
|
||||
$target_agents = explode(',', ($id_agents ?? ''));
|
||||
$cache_id_agents = [];
|
||||
foreach ($target_agents as $agent_id) {
|
||||
if (str_contains($agent_id, '|') === false) {
|
||||
|
|
|
@ -111,6 +111,20 @@ class EventsListWidget extends Widget
|
|||
*/
|
||||
protected $publicLink;
|
||||
|
||||
/**
|
||||
* Overflow scrollbar.
|
||||
*
|
||||
* @var boolean
|
||||
*/
|
||||
public $overflow_scrollbars;
|
||||
|
||||
/**
|
||||
* Position
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $position;
|
||||
|
||||
|
||||
/**
|
||||
* Construct.
|
||||
|
|
|
@ -271,7 +271,7 @@ class HeatmapWidget extends Widget
|
|||
'name' => 'groups[]',
|
||||
'returnAllGroup' => true,
|
||||
'privilege' => 'AR',
|
||||
'selected' => explode(',', $values['groups'][0]),
|
||||
'selected' => (isset($values['groups'][0]) === true) ? explode(',', $values['groups'][0]) : [],
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
],
|
||||
|
@ -305,7 +305,7 @@ class HeatmapWidget extends Widget
|
|||
'type' => 'select',
|
||||
'fields' => $tags,
|
||||
'name' => 'tags[]',
|
||||
'selected' => explode(',', $values['tags'][0]),
|
||||
'selected' => (isset($values['tags'][0]) === true) ? explode(',', $values['tags'][0]) : [],
|
||||
'return' => true,
|
||||
'multiple' => true,
|
||||
],
|
||||
|
@ -332,7 +332,7 @@ class HeatmapWidget extends Widget
|
|||
'type' => 'select',
|
||||
'fields' => $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,
|
||||
'multiple' => true,
|
||||
'nothing' => __('Not assigned'),
|
||||
|
|
|
@ -446,7 +446,7 @@ class SecurityHardening extends Widget
|
|||
{
|
||||
global $config;
|
||||
|
||||
$id_groups = explode(',', $group);
|
||||
$id_groups = explode(',', ($group ?? ''));
|
||||
if (in_array(0, $id_groups) === true) {
|
||||
$id_groups = array_keys(users_get_groups($config['id_user'], 'AR', false));
|
||||
}
|
||||
|
|
|
@ -83,7 +83,11 @@ class SnmpTraps extends Element
|
|||
{
|
||||
if ($this->isEnabled() === true) {
|
||||
$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 {
|
||||
$total = __('N/A');
|
||||
}
|
||||
|
@ -109,7 +113,11 @@ class SnmpTraps extends Element
|
|||
{
|
||||
if ($this->isEnabled() === true) {
|
||||
$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 {
|
||||
$total = __('N/A');
|
||||
}
|
||||
|
|
|
@ -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,
|
||||
10,
|
||||
|
|
|
@ -382,7 +382,7 @@ ui_print_standard_header(
|
|||
|
||||
$inventory_id_agent = (int) get_parameter('agent_id', -1);
|
||||
$inventory_agent = (string) get_parameter('agent', '');
|
||||
if (strlen($inventory_agent) == 0) {
|
||||
if (strlen(($inventory_agent ?? '')) == 0) {
|
||||
$inventory_id_agent = -1;
|
||||
$inventory_agent = __('All');
|
||||
} else if ($inventory_agent == __('All')) {
|
||||
|
|
|
@ -123,7 +123,7 @@ class Manager
|
|||
string $public_url,
|
||||
?string $ajax_url=null,
|
||||
?string $page=null,
|
||||
array $settings,
|
||||
array $settings=[],
|
||||
?int $mode=null,
|
||||
bool $composer=false
|
||||
) {
|
||||
|
|
|
@ -15,7 +15,7 @@ trait JsonSerializable
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
public function jsonSerialize():mixed
|
||||
{
|
||||
return array_map(function ($value) {
|
||||
if ($value instanceof JsonSerializableInterface) {
|
||||
|
|
|
@ -148,7 +148,7 @@ class Elements implements ArraySerializableInterface, JsonSerializable
|
|||
/**
|
||||
* @return array
|
||||
*/
|
||||
public function jsonSerialize()
|
||||
public function jsonSerialize():mixed
|
||||
{
|
||||
return $this->getArrayCopy();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,12 @@ if ($redraw === false) {
|
|||
|
||||
$output .= '<div class="header-widget">';
|
||||
$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') {
|
||||
$output .= $options['title'];
|
||||
} else {
|
||||
|
|
|
@ -43,7 +43,7 @@ $form = [
|
|||
'extra' => 'novalidate',
|
||||
];
|
||||
|
||||
$js = 'tinymce.init({
|
||||
$js .= ' tinymce.init({
|
||||
selector: "#textarea_text",
|
||||
plugins: "preview, searchreplace, table, nonbreaking, link, image",
|
||||
promotion: false,
|
||||
|
|
Loading…
Reference in New Issue