mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +02:00
Don't add nofollow for matching hosts, generalize this code.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
@@ -199,6 +199,21 @@ class HTMLPurifier_URI
|
||||
return $result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this URL might be considered a 'local' URL given
|
||||
* the current context. This is true when the host is null, or
|
||||
* when it matches the host supplied to the configuration.
|
||||
*
|
||||
* Note that this does not do any scheme checking (URI.Munge, I'm
|
||||
* looking at you).
|
||||
*/
|
||||
public function isLocal($config, $context) {
|
||||
if ($this->host === null) return true;
|
||||
$uri_def = $config->getDefinition('URI');
|
||||
if ($uri_def->host === $this->host) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// vim: et sw=4 sts=4
|
||||
|
Reference in New Issue
Block a user