The application scenario is that you can enter any text, but cannot enter code similar to html. in php, you can use FILTER_SANITIZE_STRING to filter the filtered content. Is it safe enough, for other scenarios such as xss filtering, users can enter arbitrary text, but cannot enter code similar to html.
In php, FILTER_SANITIZE_STRING can be used to filter user input.
Is the filtered content safe enough? Is it used for other purposes, such as xss filtering?
Reply content:
The application scenario is that you can enter any text, but cannot enter code similar to html.
In php, FILTER_SANITIZE_STRING can be used to filter user input.
Is the filtered content safe enough? Is it used for other purposes, such as xss filtering?
As mentioned in the titleSafe enough... The key is to see how you understand this...
The full name of XSS... XSS isCross-site Scripting... The key point is Scripting...
If you useFILTER_SANITIZE_STRING...YesThere is no risk of being XSS...
But it cannot be said that it is completely safe anywhere... other risks still exist...
For example, such content cannot be directly written into the SQL statement before being processed...
It also depends on how you display the user input...
If the content entered by the user may appear legallyScriptThe tag must also be processed...