I wonder how (if anyhow) is XSS protection provided in Laravel. I couldn\'t find anything about it in the documentation.
Problem
I am using
You also filter input before validation like, First create /app/Common/Utility.php
$value) {
$key = strip_tags($key);
if (is_array($value)) {
$result[$key] = static::cleanArray($value);
} else {
$result[$key] = trim(strip_tags($value)); // Remove trim() if you want to.
}
}
return $result;
}
}
And use in your controller like this
use App\Common\Utility;
public function store()
{
Utility::stripXSS();
// Remaining Codes
}
This code will clean your input before validation