LP#1400082 - avoid uninitialized var warning at TPAC login
authorDan Scott <dscott@laurentian.ca>
Sun, 7 Dec 2014 13:51:33 +0000 (08:51 -0500)
committerBen Shum <bshum@biblio.org>
Tue, 16 Dec 2014 19:44:47 +0000 (14:44 -0500)
Give username a default value of '', which makes the regex happy (avoiding an
uninit warning in Apache logs if no value was entered) and still counts as de
nada for the purposes of the actual login dance.

Signed-off-by: Dan Scott <dscott@laurentian.ca>
Signed-off-by: Ben Shum <bshum@biblio.org>

Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm

index 3d717ad..856b7de 100644 (file)
@@ -383,7 +383,7 @@ sub load_login {
 
     $ctx->{page} = 'login';
 
-    my $username = $cgi->param('username');
+    my $username = $cgi->param('username') || '';
     $username =~ s/\s//g;  # Remove blanks
     my $password = $cgi->param('password');
     my $org_unit = $ctx->{physical_loc} || $ctx->{aou_tree}->()->id;