MDL-14898 upgraded html purifier to 3.1.0 in HEAD
This commit is contained in:
@@ -1,26 +1,15 @@
|
||||
<?php
|
||||
|
||||
require_once 'HTMLPurifier/Injector.php';
|
||||
|
||||
HTMLPurifier_ConfigSchema::define(
|
||||
'AutoFormat', 'Linkify', false, 'bool', '
|
||||
<p>
|
||||
This directive turns on linkification, auto-linking http, ftp and
|
||||
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>
|
||||
');
|
||||
|
||||
/**
|
||||
* Injector that converts http, https and ftp text URLs to actual links.
|
||||
*/
|
||||
class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector
|
||||
{
|
||||
|
||||
var $name = 'Linkify';
|
||||
var $needed = array('a' => array('href'));
|
||||
public $name = 'Linkify';
|
||||
public $needed = array('a' => array('href'));
|
||||
|
||||
function handleText(&$token) {
|
||||
public function handleText(&$token) {
|
||||
if (!$this->allowsElement('a')) return;
|
||||
|
||||
if (strpos($token->data, '://') === false) {
|
||||
|
||||
Reference in New Issue
Block a user