#12460 fixed deprecated log

This commit is contained in:
Daniel Cebrian 2024-01-17 12:25:57 +01:00
parent a31f964753
commit bb2d908de7
10 changed files with 56 additions and 14 deletions

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

@ -517,7 +517,7 @@ class Wizard
public static function printBigButtonsList($list_data) public static function printBigButtonsList($list_data)
{ {
echo '<ul class="bigbuttonlist">'; echo '<ul class="bigbuttonlist">';
array_map('self::printBigButtonElement', $list_data); array_map(['Wizard', 'printBigButtonElement'], $list_data);
echo '</ul>'; echo '</ul>';
} }

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');
if (isset($_COOKIE[session_name()]) === true) {
setcookie(session_name(), $_COOKIE[session_name()], (time() - 4800), '/'); 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

@ -6471,7 +6471,8 @@ function event_print_graph(
]; ];
$color[] = '#82b92f'; $color[] = '#82b92f';
} }
} else { } else if ((int) $num_intervals > 0) {
// We assume that if num_interval is 0, not exist events.
$interval_length = (int) ($period / $num_intervals); $interval_length = (int) ($period / $num_intervals);
$intervals = []; $intervals = [];
$intervals[0] = $start_utimestamp; $intervals[0] = $start_utimestamp;

View File

@ -147,11 +147,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 ($text_html_decoded === null) { if (isset($text_html_decoded) === true && mb_strlen($text_html_decoded, 'UTF-8') > ($numChars)) {
$text_html_decoded = '';
}
if (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

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

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,
@ -1216,7 +1216,7 @@ if (is_ajax() === true) {
if (empty($tmp) === false && $regex !== '') { if (empty($tmp) === false && $regex !== '') {
$regex_validation = false; $regex_validation = false;
foreach (json_decode(json_encode($tmp), true) as $key => $field) { foreach (json_decode(json_encode($tmp), true) as $key => $field) {
if (preg_match('/'.$regex.'/', $field)) { if (isset($field) === true && preg_match('/'.$regex.'/', $field)) {
$regex_validation = true; $regex_validation = true;
} }
} }
@ -1234,7 +1234,7 @@ if (is_ajax() === true) {
$data = array_values( $data = array_values(
array_filter( array_filter(
$data, ((is_array($data) === true) ? $data : []),
function ($item) { function ($item) {
return (bool) (array) $item; return (bool) (array) $item;
} }