I am using TP. You can set the filtering method of function I() in the settings
But the data I want to pass in is the content of the HTML online editor
It can contain legal tags. For example
...
In order to prevent XSS attacks, it is no problem for the I function to set the default filter to htmlspecialchars, but how to keep the tags you want? There is a tutorial that uses this It is a plug-in HTMLPurifer, but the efficiency is too low and it is not recommended to use it too much.
Question: When the default filter of the I function in TP is htmlspecialchars, how can I retain the tags I want?
Reply content:
I am using TP. You can set the filtering method of function I() in the settings
But the data I want to pass in is the content of the HTML online editor
It can contain legal tags. For example
...
In order to prevent XSS attacks, it is no problem for the I function to set the default filter to htmlspecialchars, but how to keep the tags you want? There is a tutorial that uses this It is a plug-in HTMLPurifer, but the efficiency is too low and it is not recommended to use it too much.
Question: When the default filter of the I function in TP is htmlspecialchars, how can I retain the tags I want?
<code>function I($name,$default='',$filter=null,$datas=null) {</code>
Copy after login
So you can specify not to use filters when receiving edits, such as i('content','',null);