Reputation: 1047
I am capturing some content using tinyMCE, and then posting the content back to php script to store in database.
I am using htmlawed to remove anything nasty.
The content of the $_POST variable is
<p>This is a link <a href=\"https://www.bbc.co.uk\">https://www.bbc.co.uk</a></p>
I am then using this code on the server
$Details = $_POST["Details"];
$config = array('elements'=>'* -script -object'); //dont allow any scripts
$SanitizedDetails = htmLawed($Details, $config);
SanitizedDetails then contains this
<p>This is a link <a href="\">https://www.bbc.co.uk</a></p>
It has removed the contents of href (just left a backslash)
Please could somebody help with config for htmlawed
Upvotes: 1
Views: 95
Reputation: 1874
You need to delete the first backslash \
from href=\
and the last one from uk\
and you're ready to go.
Upvotes: 1