Skip to content

Commit 712d41c

Browse files
committed
title check for whitespace for title
Signed-off-by: samin-z <samin.zavarkesh@gmail.com>
1 parent 1415d35 commit 712d41c

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/Validators/BaseValidator.php

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,15 @@ private function not_null($value): bool {
104104
* @return bool
105105
*/
106106
private function not_empty($value): bool {
107-
return !empty($value);
107+
// 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);
108116
}
109117

110118
/**

0 commit comments

Comments
 (0)