Use isset instead of empty+strlen when checking disallow parameters

This line first used to be just an "strlen". Then we merged
Iaeae672dca66ffc745054daabd6f0eae7dfbc648 to clean input and this caused
some "undefined index" notices. These were in turn fixed in Ibebedb566da705e77ffb831ebda6476adba07c93 by adding an "empty". However, this slightly changed the range of accepted parameters, for instance refusing 0 and '0'. Those should never be used, so this is just a theoretical problem, but we'd better be consistent and simplify this line.

Change-Id: I4643d0632acf5926ac8de5da9bcb3e5dc715fdc1
This commit is contained in:
Daimona Eaytoy 2018-07-15 17:01:32 +02:00
parent 20dc4301f8
commit adc06f409d

View file

@ -1535,7 +1535,7 @@ class AbuseFilter {
switch ( $action ) {
case 'disallow':
if ( !empty( $parameters[0] ) && strlen( $parameters[0] ) ) {
if ( isset( $parameters[0] ) ) {
$message = [ $parameters[0], $rule_desc, $rule_number ];
} else {
// Generic message.