mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-10 07:38:41 +00:00
[2.1.0] Standardize interface for Injector (we actually got it wrong in the 2.0.1-strict version, but this'll fix it)
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1262 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
a6ede3804e
commit
584a1abd15
@ -16,7 +16,7 @@ HTMLPurifier_ConfigSchema::define(
|
|||||||
class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector
|
class HTMLPurifier_Injector_Linkify extends HTMLPurifier_Injector
|
||||||
{
|
{
|
||||||
|
|
||||||
function handleText(&$token, $config, &$context) {
|
function handleText(&$token) {
|
||||||
if (!$this->allowsElement('a')) return;
|
if (!$this->allowsElement('a')) return;
|
||||||
|
|
||||||
if (strpos($token->data, '://') === false) {
|
if (strpos($token->data, '://') === false) {
|
||||||
|
@ -34,7 +34,7 @@ class HTMLPurifier_Injector_PurifierLinkify extends HTMLPurifier_Injector
|
|||||||
$this->docURL = $config->get('AutoFormatParam', 'PurifierLinkifyDocURL');
|
$this->docURL = $config->get('AutoFormatParam', 'PurifierLinkifyDocURL');
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleText(&$token, $config, &$context) {
|
function handleText(&$token) {
|
||||||
if (!$this->allowsElement('a')) return;
|
if (!$this->allowsElement('a')) return;
|
||||||
if (strpos($token->data, '%') === false) return;
|
if (strpos($token->data, '%') === false) return;
|
||||||
|
|
||||||
|
@ -109,7 +109,7 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
|
|||||||
if ($token->type === 'text') {
|
if ($token->type === 'text') {
|
||||||
// injector handler code; duplicated for performance reasons
|
// injector handler code; duplicated for performance reasons
|
||||||
foreach ($this->injectors as $i => $x) {
|
foreach ($this->injectors as $i => $x) {
|
||||||
if (!$x->skip) $x->handleText($token, $config, $context);
|
if (!$x->skip) $x->handleText($token);
|
||||||
if (is_array($token)) {
|
if (is_array($token)) {
|
||||||
$this->currentInjector = $i;
|
$this->currentInjector = $i;
|
||||||
break;
|
break;
|
||||||
@ -166,7 +166,7 @@ class HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
|
|||||||
|
|
||||||
// injector handler code; duplicated for performance reasons
|
// injector handler code; duplicated for performance reasons
|
||||||
foreach ($this->injectors as $i => $x) {
|
foreach ($this->injectors as $i => $x) {
|
||||||
if (!$x->skip) $x->handleStart($token, $config, $context);
|
if (!$x->skip) $x->handleStart($token);
|
||||||
if (is_array($token)) {
|
if (is_array($token)) {
|
||||||
$this->currentInjector = $i;
|
$this->currentInjector = $i;
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user