fix a few php8 warnings

This commit is contained in:
Eric Schultz
2022-12-14 15:20:56 -07:00
parent 92a4158f2a
commit a06e7ab885
3 changed files with 6 additions and 4 deletions
@@ -97,13 +97,13 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
//support
$support = plugin('support',$plugin_file) ?: "";
$support = $support ? "<a href='$support' target='_blank'>"._('Support Thread')."</a>" : "";
//category
$category = plugin('category',$plugin_file) ?: (strpos($version,'-')!==false ? 'next' : 'stable');
//author
$author = plugin('author',$plugin_file) ?: _('anonymous');
//version
$version = plugin('version',$plugin_file) ?: _('unknown');
$date = str_replace('.','',$version);
//category
$category = plugin('category',$plugin_file) ?: (strpos($version,'-')!==false ? 'next' : 'stable');
//status
$status = $check ? _('unknown') : _('checking').'...';
$id = str_replace('.','-',$name);
+1 -1
View File
@@ -119,7 +119,7 @@ function translate($key) {
// main
$language = [];
$locale = $_SESSION['locale'] ?? $login_locale;
$locale = $_SESSION['locale'] ?? ($login_locale??'');
$return = "function _(t){return t;}";
$jscript = "$docroot/webGui/javascript/translate.en_US.js";
$root = "$docroot/languages/en_US/helptext.txt";
+3 -1
View File
@@ -27,7 +27,9 @@ ini_set("session.use_strict_mode", "1");
// Safari bug prevents use of 'Strict'
// ini_set("session.cookie_samesite", $secure?'Strict':'Lax');
ini_set("session.cookie_samesite", 'Lax');
session_name("unraid_".md5(strstr($_SERVER['HTTP_HOST'].':', ':', true)));
if (array_key_exists('HTTP_HOST', $_SERVER)) {
session_name("unraid_".md5(strstr($_SERVER['HTTP_HOST'].':', ':', true)));
}
session_set_cookie_params(0, '/', null, $secure, true);
if ($_SERVER['SCRIPT_NAME'] != '/login.php' && $_SERVER['SCRIPT_NAME'] != '/auth-request.php' && isset($_SERVER['REQUEST_METHOD']) && $_SERVER['REQUEST_METHOD'] === 'POST') {
if (!isset($var)) $var = parse_ini_file('state/var.ini');