Welcome Guest, Not a member yet? Register   Sign In
Should $request->getPost() and others modify data even when no filtering specified?
#6

I see. I think the problem is that we cannot just suddenly start passing back NULL as this could mess up other developers. You may be able to fix this in your application by passing FILTER_FLAG_EMPTY_STRING_NULL as an additional $flag:
https://3v4l.org/puPvf

Note though that this also causes '' to return NULL, which may or may not be desirable for your use case.

It is odd to me that filter_var with “unsafe raw” converts null values to strings but that’s on PHP, not CodeIgniter.
Reply


Messages In This Thread
RE: Should $request->getPost() and others modify data even when no filtering specified? - by MGatner - 04-10-2021, 05:33 AM



Theme © iAndrew 2016 - Forum software by © MyBB