From 56cf444927c38f8236495e25956a171c438d8fb5 Mon Sep 17 00:00:00 2001 From: Marc Veron Date: Wed, 10 Oct 2012 07:49:36 +0200 Subject: [PATCH] Bug 8895 - Warning in systempreferences.pl: Use of uninitialized value in length... Clicking on Local use tab in system preferences results in warning in log file: systempreferences.pl: Use of uninitialized value in length at (...)/admin/systempreferences.pl line 456 Reason: content field "value" in table "systempreferences" can be NULL (and is tested for length). Added test for "defined" at to places. Signed-off-by: Kyle M Hall Signed-off-by: Paul Poulain --- admin/systempreferences.pl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 175f6a0481..41130b2051 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -420,6 +420,7 @@ sub StringSearch { my $sth = $dbh->prepare("Select variable,value,explanation,type,options from systempreferences where (variable like ?) order by variable"); $sth->execute($syspref); while ( my $data = $sth->fetchrow_hashref ) { + unless (defined $data->{value}) { $data->{value} = "";} $data->{shortvalue} = $data->{value}; $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if defined( $data->{value} ) and length( $data->{value} ) > 60; push( @results, $data ); @@ -452,6 +453,7 @@ sub StringSearch { } while ( my $data = $sth->fetchrow_hashref ) { + unless (defined $data->{value}) { $data->{value} = "";} $data->{shortvalue} = $data->{value}; $data->{shortvalue} = substr( $data->{value}, 0, 60 ) . "..." if length( $data->{value} ) > 60; push( @results, $data ); -- 2.39.5