From bee65bc575042218d587a09035359656df0741e5 Mon Sep 17 00:00:00 2001 From: Daniel Maya Date: Wed, 26 Jul 2023 14:18:20 +0200 Subject: [PATCH] #11739 Fixed deprecated functions --- pandora_console/godmode/menu.php | 8 ++++++-- pandora_console/include/functions.php | 2 +- pandora_console/include/functions_menu.php | 4 ++-- pandora_console/include/functions_ui.php | 5 ++++- pandora_console/include/streams.php | 1 + pandora_console/index.php | 2 +- 6 files changed, 15 insertions(+), 7 deletions(-) diff --git a/pandora_console/godmode/menu.php b/pandora_console/godmode/menu.php index 3d04b230b0..e46072bfd7 100644 --- a/pandora_console/godmode/menu.php +++ b/pandora_console/godmode/menu.php @@ -502,9 +502,13 @@ if ($access_console_node === true) { $sub2[$extmenu['sec2']]['refr'] = 0; } else { if (is_array($extmenu) === true && array_key_exists('fatherId', $extmenu) === true) { - if (strlen($extmenu['fatherId']) > 0) { + if (empty($extmenu['fatherId']) === false + && strlen($extmenu['fatherId']) > 0 + ) { if (array_key_exists('subfatherId', $extmenu) === true) { - if (strlen($extmenu['subfatherId']) > 0) { + if (empty($extmenu['subfatherId']) === false + && strlen($extmenu['subfatherId']) > 0 + ) { $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['text'] = __($extmenu['name']); $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['id'] = str_replace(' ', '_', $extmenu['name']); $menu_godmode[$extmenu['fatherId']]['sub'][$extmenu['subfatherId']]['sub2'][$extmenu['sec2']]['refr'] = 0; diff --git a/pandora_console/include/functions.php b/pandora_console/include/functions.php index ee4ee7d1ab..e8f0ac3452 100644 --- a/pandora_console/include/functions.php +++ b/pandora_console/include/functions.php @@ -907,7 +907,7 @@ function set_cookie($name, $value) { if (is_null($value)) { unset($_COOKIE[$value]); - setcookie($name, null, -1, '/'); + setcookie($name, '', -1, '/'); } else { setcookie($name, $value); } diff --git a/pandora_console/include/functions_menu.php b/pandora_console/include/functions_menu.php index ff18544586..143a538e20 100644 --- a/pandora_console/include/functions_menu.php +++ b/pandora_console/include/functions_menu.php @@ -353,7 +353,7 @@ function menu_print_menu(&$menu) $secExtensionBool = false; if ($secExtensionBool) { - if (strlen($sub['icon']) > 0) { + if (empty($sub['icon']) === false && strlen($sub['icon']) > 0) { $icon_enterprise = false; if (isset($sub['enterprise'])) { $icon_enterprise = (bool) $sub['enterprise']; @@ -380,7 +380,7 @@ function menu_print_menu(&$menu) $secExtension = $sub['sec']; } - if (strlen($secExtension) > 0) { + if (empty($secExtension) === false && strlen($secExtension) > 0) { $secUrl = $secExtension; $extensionInMenu = 'extension_in_menu='.$mainsec.'&'; } else { diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index c5b83e48ae..150a6b7b9b 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4788,7 +4788,10 @@ function ui_get_url_refresh($params=false, $relative=true, $add_post=true) $url .= $key.'['.$k.']='.$v.'&'; } } else { - $url .= $key.'='.io_safe_input(rawurlencode($value)).'&'; + $aux = (empty($value) === false) + ? io_safe_input(rawurlencode($value)) + : ''; + $url .= $key.'='.$aux.'&'; } } diff --git a/pandora_console/include/streams.php b/pandora_console/include/streams.php index 9097750bf7..72f62ecce8 100644 --- a/pandora_console/include/streams.php +++ b/pandora_console/include/streams.php @@ -59,6 +59,7 @@ class StreamReader { class StringReader { var $_pos; var $_str; + var $is_overloaded; function __construct($str='') { $this->_str = $str; diff --git a/pandora_console/index.php b/pandora_console/index.php index 75c00af9b1..b3566e3589 100755 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -292,7 +292,7 @@ enterprise_include_once('include/auth/saml.php'); if (isset($config['id_user']) === false) { // Clear error messages. unset($_COOKIE['errormsg']); - setcookie('errormsg', null, -1); + setcookie('errormsg', '', -1); if (isset($_GET['login']) === true) { include_once 'include/functions_db.php';