From 2ffba44d3659147ad5bca87f6ff4b224b7c403cc Mon Sep 17 00:00:00 2001 From: Dan Scott Date: Sat, 4 Aug 2012 10:43:31 -0400 Subject: [PATCH] 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 Signed-off-by: Bill Erickson --- .../src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm | 3 ++- Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm index 8d577da..f7220b1 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 1baf0ab..25285b1 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGWeb.pm @@ -154,7 +154,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 { -- 1.7.2.5