Welcome Guest, Not a member yet? Register   Sign In
Validation | trim causes 500: Internal Server Error
#2

(This post was last modified: 04-27-2024, 05:13 AM by kenjis.)

The validation rule trim does not exist from the beginning.
But you can use any native PHP functions that return boolean and permit at least one parameter.

Quote:Note
You can also use any native PHP functions that return boolean and permit at least one parameter, the field data to validate. The Validation library never alters the data to validate.
https://codeigniter4.github.io/CodeIgnit...eneral-use

But trim does not return boolean, so you cannot use it as a validation rule.

In CI3, you could use trim as a rule, because CI3 modified the data to validate.
But CI4 Validation does not modified any data to validate, so your rule 'trim|max_length[...' is a misuse or does not make sense.
Because the rule trim does nothing.
Reply


Messages In This Thread
RE: Validation | trim causes 500: Internal Server Error - by kenjis - 04-27-2024, 04:34 AM



Theme © iAndrew 2016 - Forum software by © MyBB