Closed shishamo closed 1 year ago
It seems '2023-08-31T15:00:00+0900dummy'
is valid for strtotime()
.
See https://3v4l.org/77f1q
I recommend you specify a date format. See https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html?highlight=valid_date#rules-for-general-use
@kenjis oh i see thank you
I sent a PR to update the user guide: https://github.com/codeigniter4/CodeIgniter4/pull/7558/files#diff-75e5e834c9c260f8111e1ebc2fcab1b523eb040c6ee1ac31f9a65f4895a9a0f0R849-R854
valid_date
Fails if field does not contain a valid date. Any string that strtotime() accepts is valid if you don’t specify an optional parameter to matches a date format. So it is usually necessary to specify the parameter.
https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#rules-for-general-use
PHP Version
8.1
CodeIgniter4 Version
4.3.4
CodeIgniter4 Installation Method
Manual (zip or tar.gz)
Which operating systems have you tested for this bug?
macOS
Which server did you use?
apache
Database
PostgreSQL 15.2
What happened?
the validation rules
valid_date
don't handle a wrong date formatSteps to Reproduce
Expected Output
should return a validation failing
Anything else?
No response