Move control character checking to FU::Validate, deprecate FU::Util::utf8_decode()
URI, JSON and formdata decoding no longer checks for control characters, but FU::Validate now rejects control characters by default. This decouples semantic validation from format parsing and gives better control over when control characters are allowed.
This commit is contained in:
parent
2e9a40da69
commit
a8ac435f85
8 changed files with 39 additions and 49 deletions
|
|
@ -79,6 +79,10 @@ t { trim => 0 }, " Va\rl id \n ", " Va\rl id \n ";
|
|||
f {}, ' ', { validation => 'required' }, 'required value missing';
|
||||
t { trim => 0 }, ' ', ' ';
|
||||
|
||||
# allow_control
|
||||
f {}, "\b", { validation => 'allow_control' }, 'invalid control character';
|
||||
t { allow_control => 1 }, "\b", "\b";
|
||||
|
||||
# accept_array
|
||||
t { default => undef, accept_array => 'first' }, [], undef;
|
||||
t { default => undef, accept_array => 'first' }, [' x '], 'x';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue