Bug 11135: (follow-up) improve testing of OVERRIDE_SYSPREF_NAMES
authorGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 14:21:25 +0000 (14:21 +0000)
committerGalen Charlton <gmc@esilibrary.com>
Thu, 31 Oct 2013 14:21:25 +0000 (14:21 +0000)
This is a bit pedantic -- since for obvious reasons, I can't
see us ever letting '0' be the name of a system preference,
and I suspect it's impossible for the value of something in the
$ENV hash to be undefined -- but better to test for exactly what
we mean.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
admin/preferences.pl

index 9a2c8ca..8bcdb0a 100755 (executable)
@@ -122,7 +122,9 @@ sub TransformPrefsToHTML {
     $tab = { '' => $tab } if ( ref( $tab ) eq 'ARRAY' );
 
     my @override_syspref_names;
-    if ( $ENV{OVERRIDE_SYSPREF_NAMES} ) {
+    if ( exists($ENV{OVERRIDE_SYSPREF_NAMES}) &&
+         defined($ENV{OVERRIDE_SYSPREF_NAMES})
+       ) {
         @override_syspref_names = split /,/, $ENV{OVERRIDE_SYSPREF_NAMES};
     }