mirror of
https://github.com/mailcow/mailcow-dockerized.git
synced 2025-12-15 19:06:03 +00:00
Merge pull request #6651 from psuet/fix/php-warnings
Fix multiple PHP Warnings present in "stock" installation
This commit is contained in:
@@ -26,6 +26,7 @@ if (is_array($alertbox_log_parser)) {
|
|||||||
|
|
||||||
// map tfa details for twig
|
// map tfa details for twig
|
||||||
$pending_tfa_authmechs = [];
|
$pending_tfa_authmechs = [];
|
||||||
|
if (array_key_exists('pending_tfa_methods', $_SESSION)) {
|
||||||
foreach($_SESSION['pending_tfa_methods'] as $authdata){
|
foreach($_SESSION['pending_tfa_methods'] as $authdata){
|
||||||
$pending_tfa_authmechs[$authdata['authmech']] = false;
|
$pending_tfa_authmechs[$authdata['authmech']] = false;
|
||||||
}
|
}
|
||||||
@@ -44,6 +45,7 @@ if (!isset($pending_tfa_authmechs['webauthn'])
|
|||||||
if (isset($pending_tfa_authmechs['u2f'])) {
|
if (isset($pending_tfa_authmechs['u2f'])) {
|
||||||
$pending_tfa_authmechs['u2f'] = true;
|
$pending_tfa_authmechs['u2f'] = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// globals
|
// globals
|
||||||
$globalVariables = [
|
$globalVariables = [
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ function customize($_action, $_item, $_data = null) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (empty($app_links)){
|
if (empty($app_links)){
|
||||||
return false;
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert from old style
|
// convert from old style
|
||||||
|
|||||||
@@ -2211,7 +2211,7 @@ function cors($action, $data = null) {
|
|||||||
$cors_settings['allowed_origins'] = $allowed_origins[0];
|
$cors_settings['allowed_origins'] = $allowed_origins[0];
|
||||||
if (in_array('*', $allowed_origins)){
|
if (in_array('*', $allowed_origins)){
|
||||||
$cors_settings['allowed_origins'] = '*';
|
$cors_settings['allowed_origins'] = '*';
|
||||||
} else if (in_array($_SERVER['HTTP_ORIGIN'], $allowed_origins)) {
|
} else if (array_key_exists('HTTP_ORIGIN', $_SERVER) && in_array($_SERVER['HTTP_ORIGIN'], $allowed_origins)) {
|
||||||
$cors_settings['allowed_origins'] = $_SERVER['HTTP_ORIGIN'];
|
$cors_settings['allowed_origins'] = $_SERVER['HTTP_ORIGIN'];
|
||||||
}
|
}
|
||||||
// always allow OPTIONS for preflight request
|
// always allow OPTIONS for preflight request
|
||||||
|
|||||||
Reference in New Issue
Block a user