Should $request->getPost() and others modify data even when no filtering specified? |
(04-09-2021, 04:26 AM)MGatner Wrote:(04-01-2021, 02:39 PM)andre.tannus Wrote: I believe the culprit is filter_var($value, $filter, $flags), which will convert nulls to empty string even if FILTER_UNSAFE_RAW (which according to php docs should let any value through). Well, from my tests, filter_var with FILTER_UNSAFE_RAW does convert nulls to empty strings. This may have stayed under the radar since it is being used to filter POST data, which is always in string format. One of my concerns is people implicitly relying on the data being composed exclusively of strings but that will remain true as long as they are not fiddling with it in a Filter, but again, if they are, and rely on this cast to prevent, say, nulls from being sent to the db, then it will break things somewhere. Shall I roll up my sleeves? |
Messages In This Thread |
Should $request->getPost() and others modify data even when no filtering specified? - by andre.tannus - 04-01-2021, 02:39 PM
RE: Should $request->getPost() and others modify data even when no filtering specified? - by MGatner - 04-08-2021, 07:23 AM
RE: Should $request->getPost() and others modify data even when no filtering specified? - by andre.tannus - 04-08-2021, 08:04 AM
RE: Should $request->getPost() and others modify data even when no filtering specified? - by MGatner - 04-09-2021, 04:26 AM
RE: Should $request->getPost() and others modify data even when no filtering specified? - by andre.tannus - 04-09-2021, 07:09 AM
RE: Should $request->getPost() and others modify data even when no filtering specified? - by MGatner - 04-10-2021, 05:33 AM
|