How to handle arrays in request payload (i.e. $_GET and $_POST)? #15441
Replies: 2 comments 1 reply
-
BTW: I've found some websites made with Phalcon now, that are using pagination for example. Simply modifying query parameter |
Beta Was this translation helpful? Give feedback.
-
Could you please create an issue with described examples and desired functionality? |
Beta Was this translation helpful? Give feedback.
-
Imagine a simple form
Imagine now, that a script kiddie modifies POST payload and sending
firstname[]=hacked
instead offirstname=john
. Then, Phalcon will throw an exception:Sure, this is a rare case, but it can happen. It's fatal to pass
$_POST
(as suggest in documentation) to form. Now, what's a clean way to sanitize payload, that form accepts only string values?Just for notice: I've tried it with
->setFilters(['string'])
already, but same thing.Beta Was this translation helpful? Give feedback.
All reactions