From 558ec626fe20fef5e038370d3bcaf2a105626fa2 Mon Sep 17 00:00:00 2001 From: Andrew Nugged Date: Sun, 10 May 2020 13:34:58 +0300 Subject: [PATCH] Bug 25440: Fix for "uninitialized $maxsuspensiondays" in smart-rules.pl This warning emitted: Use of uninitialized value $maxsuspensiondays in string eq at /admin/smart-rules.pl line 257. But that not just undef-warning, there is broken logic, these two lines are mutually contradictory and goes one-by-one: $maxsuspensiondays = undef if $maxsuspensiondays eq q||; $maxsuspensiondays = '' if $maxsuspensiondays eq q||; Fix is simple: both removed. --- admin/smart-rules.pl | 2 -- 1 file changed, 2 deletions(-) diff --git a/admin/smart-rules.pl b/admin/smart-rules.pl index 6bea920dd9..0a2c18873a 100755 --- a/admin/smart-rules.pl +++ b/admin/smart-rules.pl @@ -253,8 +253,6 @@ elsif ($op eq 'add') { my $fine = $input->param('fine'); my $finedays = $input->param('finedays'); my $maxsuspensiondays = $input->param('maxsuspensiondays'); - $maxsuspensiondays = undef if $maxsuspensiondays eq q||; - $maxsuspensiondays = '' if $maxsuspensiondays eq q||; my $suspension_chargeperiod = $input->param('suspension_chargeperiod') || 1; my $firstremind = $input->param('firstremind'); my $chargeperiod = $input->param('chargeperiod'); -- 2.17.1