David 10K
David 10K

Reputation: 303

html purifier - allow links?

Old problem with links and html purfier. I'm using this code:

$config = HTMLPurifier_Config::createDefault();  
$config->set('HTML.Allowed', 'p,b,a[href],i');  
$config->set('HTML.AllowedAttributes', 'a.href');  
$purifier = new HTMLPurifier($config);

But it doesn't work. The input

<a href="http://www.google.de">search</a>

will be turned to

<a href="%5C">search</a>

Any ideas?

Upvotes: 2

Views: 1218

Answers (1)

Edward Z. Yang
Edward Z. Yang

Reputation: 26762

Turn off magic quotes. http://php.net/manual/en/security.magicquotes.disabling.php

Upvotes: 3

Related Questions