Welcome Guest, Not a member yet? Register   Sign In
Sanitization with form validation
#1

Why we cant use trim(), htmlspecialchars() like methods in form validation rules?

for example......

PHP Code:
'name' => [
    'label' => 'Name',
    'rules' => 'trim|htmlspecialchars|required'
]; 

Is there any easy way that we can sanitize $_POST data at once? 

I know we can do something like htmlspecialchars($request->getPost('name')); 

But its nice if there any way that can pass a array like validation rules and sanitize multiple post vars at once. than wrapping with php native methods.

thanks.
Reply


Messages In This Thread
Sanitization with form validation - by MrWhite - 01-13-2021, 02:01 AM
RE: Sanitization with form validation - by iRedds - 01-15-2021, 07:32 PM



Theme © iAndrew 2016 - Forum software by © MyBB