LP#1400082 - avoid uninitialized var warning at TPAC login user/dbs/lp1400082_avoid_uninit_username_in_login
authorDan Scott <dscott@laurentian.ca>
Sun, 7 Dec 2014 13:51:33 +0000 (08:51 -0500)
committerDan Scott <dscott@laurentian.ca>
Sun, 7 Dec 2014 13:51:33 +0000 (08:51 -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>
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;