We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1415d35 commit 712d41cCopy full SHA for 712d41c
1 file changed
lib/Validators/BaseValidator.php
@@ -104,7 +104,15 @@ private function not_null($value): bool {
104
* @return bool
105
*/
106
private function not_empty($value): bool {
107
- return !empty($value);
+ // Treat string zero as a valid non-empty value while still rejecting other empty values
108
+ if ($value === '0') {
109
+ return true;
110
+ }
111
+
112
+ if (is_string($value)) {
113
+ return strlen(trim($value)) > 0;
114
115
+ return !empty($value);
116
}
117
118
/**
0 commit comments