`empty('0')` will return true, despite the string not actually being empty
which is undesired.
Fixes WoltLab/com.woltlab.wbb#387
else {
if ($structure === self::STRUCT_FLAT) {
$target[$variableName] = StringUtil::trim($target[$variableName]);
- if (!$allowEmpty && empty($target[$variableName])) {
+ if (!$allowEmpty && $target[$variableName] === '') {
throw new UserInputException($variableName);
}
}
}
for ($i = 0, $length = count($target[$variableName]); $i < $length; $i++) {
- if (empty($target[$variableName][$i])) {
+ if ($target[$variableName][$i] === '') {
throw new UserInputException($variableName);
}
}