1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

[2.1.0] Friendly error messages for when injector needs a tag that's not allowed added

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1265 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-06-28 13:06:15 +00:00
parent 9dd7c8c7dd
commit a96b5bf612
9 changed files with 73 additions and 10 deletions

View File

@@ -6,7 +6,8 @@ HTMLPurifier_ConfigSchema::define(
'AutoFormat', 'Linkify', false, 'bool', '
<p>
This directive turns on linkification, auto-linking http, ftp and
https URLs. This directive has been available since 2.0.1.
https URLs. <code>a</code> tags with the <code>href</code> attribute
must be allowed. This directive has been available since 2.0.1.
</p>
');
@@ -16,6 +17,9 @@ HTMLPurifier_ConfigSchema::define(
class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector
{
var $name = 'Linkify';
var $needed = array('a' => array('href'));
function handleText(&$token) {
if (!$this->allowsElement('a')) return;