From: Dan Scott Date: Sat, 4 Aug 2012 14:43:31 +0000 (-0400) Subject: TPAC: Silence two uninit variable warnings X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=8f2e7fbce3900acfa71f67343a47407dd9c6b45f;p=contrib%2FConifer.git TPAC: Silence two uninit variable warnings These warnings were being thrown on every TPAC page request, slowly filling the logs: Use of uninitialized value $set_locale in string eq at /usr/local/share/perl/5.10.1/OpenILS/WWW/EGWeb.pm line 159. Use of uninitialized value in pattern match (m//) at /usr/local/share/perl/5.10.1/OpenILS/WWW/EGCatLoader.pm line 250. Banish them. Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 218e2d266f..81cbfc665a 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm @@ -247,7 +247,8 @@ sub load_common { $ctx->{full_path} = $ctx->{base_path} . $self->cgi->path_info; $ctx->{unparsed_uri} = $self->apache->unparsed_uri; $ctx->{opac_root} = $ctx->{base_path} . "/opac"; # absolute base url - $ctx->{is_staff} = ($self->apache->headers_in->get('OILS-Wrapper') =~ /true/); + my $oils_wrapper = $self->apache->headers_in->get('OILS-Wrapper') || ''; + $ctx->{is_staff} = ($oils_wrapper =~ /true/); $ctx->{proto} = 'oils' if $ctx->{is_staff}; $ctx->{physical_loc} = $self->get_physical_loc; diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm index 6bfae7a788..fc4374ca3f 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -155,7 +155,7 @@ sub load_context { $ctx->{locales} = \%registered_locales; # Set a locale cookie if the requested locale is valid - my $set_locale = $cgi->param('set_eg_locale'); + my $set_locale = $cgi->param('set_eg_locale') || ''; if (!(grep {$_ eq $set_locale} keys %registered_locales)) { $set_locale = ''; } else {