You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've recently had a bot attacking a site and throwing all sorts of random data at it's forms.
The resulting error: htmlspecialchars(): Argument #1 ($string) must be of type string, array given caused by them passing an array of data to an expected string value such as name.
Has anyone had this issue before and how have you dealt with it?
My current plan is my own version of old() with a 3rd parameter for the expected data type the value should be, returning null if the value from the session does not match.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
I've recently had a bot attacking a site and throwing all sorts of random data at it's forms.
The resulting error:
htmlspecialchars(): Argument #1 ($string) must be of type string, array given
caused by them passing an array of data to an expected string value such asname
.Has anyone had this issue before and how have you dealt with it?
My current plan is my own version of
old()
with a 3rd parameter for the expected data type the value should be, returningnull
if the value from the session does not match.implemented as:
Is there a better way of doing this in the framework?
Should there be?
Beta Was this translation helpful? Give feedback.
All reactions