Merge branch 'ent-11739-compatibilidad-php-8-2-second' into 'develop'

Ent 11739 compatibilidad php 8 2 second

See merge request artica/pandorafms!6300
This commit is contained in:
Rafael Ameijeiras 2023-08-04 06:32:37 +00:00
commit 0b680568b5
40 changed files with 77 additions and 44 deletions

View File

@ -228,7 +228,9 @@ echo sprintf('<div id="header_table" class="header_table_%s">', $menuTypeClass);
);
$autorefresh_list = json_decode(
$select[0]['autorefresh_white_list']
(empty($select[0]['autorefresh_white_list']) === false)
? $select[0]['autorefresh_white_list']
: ''
);
$header_autorefresh = '';

View File

@ -931,7 +931,7 @@ foreach ($fields as $field) {
// Filling the data.
$combo = [];
$combo = $field['combo_values'];
$combo = explode(',', $combo);
$combo = explode(',', (empty($combo) === true) ? [] : $combo);
$combo_values = [];
foreach ($combo as $value) {
$combo_values[$value] = $value;

View File

@ -1772,7 +1772,9 @@ $table_other->data[$row][] = html_print_label_input_block(
100,
true
).ui_print_input_placeholder(
__('Example').': '.date($config['date_format']),
__('Example').': '.date(
str_replace('&#x20;', ' ', $config['date_format'])
),
true
)
);

View File

@ -2392,7 +2392,9 @@ class NetworkMap
unlink($filename_dot);
if (function_exists($this->customParser)) {
if (empty($this->customParser) === false
&& function_exists($this->customParser)
) {
try {
if (empty($this->customParserArgs)) {
$graph = call_user_func(

View File

@ -2128,6 +2128,12 @@ function config_process_config()
if (!isset($config['date_format'])) {
config_update_value('date_format', 'F j, Y, g:i a');
} else {
$config['date_format'] = str_replace(
'&#x20;',
' ',
$config['date_format']
);
}
if (!isset($config['event_view_hr'])) {

View File

@ -1003,6 +1003,10 @@ function grafico_modulo_sparse($params)
];
}
if ($data_module_graph === false) {
$data_module_graph = [];
}
$data_module_graph['series_suffix'] = $series_suffix;
// Check available data.

View File

@ -578,6 +578,10 @@ function html_print_select_groups(
if (empty($nothing) === false) {
$fields[$nothing_value] = $nothing;
if ($include_groups === false) {
$include_groups = [];
}
$include_groups[$nothing_value] = $nothing;
}

View File

@ -221,6 +221,10 @@ function io_safe_output_array(&$item, $key=false, $utf8=true)
*/
function io_safe_output($value, $utf8=true)
{
if (empty($value) === true) {
return $value;
}
if (is_numeric($value)) {
return $value;
}
@ -235,16 +239,16 @@ function io_safe_output($value, $utf8=true)
$value = utf8_encode($value);
}
// Replace the html entitie of ( for the char
// Replace the html entitie of ( for the char.
$value = str_replace('&#40;', '(', $value);
// Replace the html entitie of ) for the char
// Replace the html entitie of ) for the char.
$value = str_replace('&#41;', ')', $value);
// Replace the html entitie of < for the char
// Replace the html entitie of < for the char.
$value = str_replace('&lt;', '<', $value);
// Replace the html entitie of > for the char
// Replace the html entitie of > for the char.
$value = str_replace('&gt;', '>', $value);
if ($utf8) {

View File

@ -884,7 +884,7 @@ function ui_print_os_icon(
$networkmap=false,
$only_src=false,
$relative=false,
$options=false,
$options=[],
$big_icons=false
) {
$subfolder = '.';

View File

@ -353,11 +353,7 @@ class ClusterManager
*/
public function getCount()
{
if (isset($this->count) !== true) {
$this->count = $this->getAll('count');
}
return $this->count;
return $this->getAll('count');
}

View File

@ -2286,7 +2286,12 @@ if (enterprise_installed()) {
$map_dash_details['z_dash'] = $z_dash;
$networkmap = db_get_row('tmap', 'id', $id);
} else {
$networkmap_filter = json_decode($networkmap['filter'], true);
$networkmap_filter = json_decode(
(empty($networkmap['filter']) === false)
? $networkmap['filter']
: '',
true
);
if ($networkmap_filter['x_offs'] != null) {
$map_dash_details['x_offs'] = $networkmap_filter['x_offs'];
} else {

View File

@ -496,7 +496,7 @@ class Client
throw new \Exception('Please provide homedir path to use UMC');
}
if (is_dir($this->remoteConfig) === true
if (empty($this->remoteConfig) === false && is_dir($this->remoteConfig) === true
&& is_dir($this->remoteConfig.'/updates') === false
) {
mkdir($this->remoteConfig.'/updates/');

View File

@ -29,7 +29,7 @@ class DataSetCollection extends ArrayAccess implements JsonSerializable
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
$rows = [];
foreach ($this->data as $row) {

View File

@ -23,6 +23,8 @@ class Defaults implements ChartOwnedInterface, ArraySerializableInterface, JsonS
*/
private $font;
protected $watermark;
/**
* Return Font.
@ -57,7 +59,7 @@ class Defaults implements ChartOwnedInterface, ArraySerializableInterface, JsonS
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

@ -15,7 +15,7 @@ class LabelsCollection extends ArrayAccess implements JsonSerializable
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->data;
}

View File

@ -326,7 +326,7 @@ class Options implements ChartOwnedInterface, ArraySerializableInterface, JsonSe
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -14,6 +14,12 @@ class Plugins implements ArraySerializableInterface, JsonSerializable
{
use ArraySerializable;
protected $legend;
protected $title;
protected $datalabels;
/**
* Return Legend.
@ -64,7 +70,7 @@ class Plugins implements ArraySerializableInterface, JsonSerializable
*
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -64,7 +64,7 @@ class XAxis extends Scale
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

@ -30,7 +30,7 @@ class XAxisCollection extends ArrayAccess implements ArraySerializableInterface,
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

@ -30,7 +30,7 @@ class YAxisCollection extends ArrayAccess implements ArraySerializableInterface,
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->getArrayCopy();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -15,7 +15,7 @@ class PluginsCollection extends ArrayAccess implements JsonSerializable
/**
* @return array
*/
public function jsonSerialize()
public function jsonSerialize():mixed
{
return $this->data;
}