95_Dashboard: fix Perl warning in Docker environment

git-svn-id: https://svn.fhem.de/fhem/trunk/fhem@21180 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2020-02-11 21:04:55 +00:00
parent 055f1026cc
commit 9e7cbdc63c
2 changed files with 16 additions and 4 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- bugfix: 95_Dashboard: fix Perl warning in Docker environment
- bugfix: 77_SMAEM: fix Perl warning if no frequence is delivered
- bugfix: 93_DbRep: fix Perl warning
- feature: 70_DENON_AVR: added more surround modes (thx Shadow3561)

View File

@ -4,7 +4,7 @@
#
# written and released by Sascha Hermann 2013
#
# maintained 2019 by Heiko Maaz
# maintained 2019-2020 by Heiko Maaz
# e-mail: Heiko dot Maaz at t-online dot de
#
# This script is part of fhem.
@ -42,6 +42,7 @@ package main;
use strict;
use warnings;
eval "use FHEM::Meta;1" or my $modMetaAbsent = 1;
use Data::Dumper;
use vars qw(%FW_icons); # List of icons
use vars qw($FW_dir); # base directory for web server
@ -55,6 +56,7 @@ use vars qw($FW_ss); # is smallscreen, needed by 97_GROUP/95_VIEW
# Versions History intern
our %Dashboard_vNotesIntern = (
"3.17.1" => "10.02.2020 fix perl warning, Forum: https://forum.fhem.de/index.php/topic,16503.msg1023004.html#msg1023004 ",
"3.17.0" => "06.10.2019 Path handling of backgroundimage changed ",
"3.16.0" => "04.10.2019 new attribute dashboard_hideGroupHeader, commandref revised ",
"3.15.2" => "29.09.2019 fix warnings, Forum: https://forum.fhem.de/index.php/topic,16503.msg978883.html#msg978883 ",
@ -1053,9 +1055,18 @@ sub Dashboard_GetActiveTab ($;$) {
}
if (defined($FW_httpheader{Cookie})) {
Log3 ($name, 4, "Dashboard $name - Cookie set: ".$FW_httpheader{Cookie});
my %cookie = map({ split('=', $_) } split(/; */, $FW_httpheader{Cookie}));
if (defined($cookie{dashboard_activetab})) {
Log3 ($name, 4, "Dashboard $name - Cookie delivered: ".$FW_httpheader{Cookie});
# my %cookie = map({ split('=', $_) } split(/; */, $FW_httpheader{Cookie}));
my %cookie; # 10.02.2020, Forum: https://forum.fhem.de/index.php/topic,16503.msg1023004.html#msg1023004
foreach (split(/; */, $FW_httpheader{Cookie})) {
my ($k,$v) = split('=', $_);
next if(!defined $v);
$cookie{$k} = $v;
}
Log3($name, 5, "Dashboard $name - Cookie Hash: ". Dumper %cookie);
if (defined($cookie{dashboard_activetab})) {
$activeTab = $cookie{dashboard_activetab};
$activeTab = ($activeTab <= $maxTab)?$activeTab:$maxTab;
}