ILIAS
release_5-4 Revision v5.4.26-12-gabc799a52e6
◀ ilDoc Overview
HostBlacklist.php
Go to the documentation of this file.
1
<?
php
2
3
// It's not clear to me whether or not Punycode means that hostnames
4
// do not have canonical forms anymore. As far as I can tell, it's
5
// not a problem (punycoding should be identity when no Unicode
6
// points are involved), but I'm not 100% sure
7
class
HTMLPurifier_URIFilter_HostBlacklist
extends
HTMLPurifier_URIFilter
8
{
12
public
$name
=
'HostBlacklist'
;
13
17
protected
$blacklist
= array();
18
23
public
function
prepare
(
$config
)
24
{
25
$this->blacklist =
$config
->get(
'URI.HostBlacklist'
);
26
return
true
;
27
}
28
35
public
function
filter
(&$uri,
$config
,
$context
)
36
{
37
foreach
($this->blacklist as $blacklisted_host_fragment) {
38
if
(strpos($uri->host, $blacklisted_host_fragment) !==
false
) {
39
return
false
;
40
}
41
}
42
return
true
;
43
}
44
}
45
46
// vim: et sw=4 sts=4
HTMLPurifier_URIFilter_HostBlacklist
Definition:
HostBlacklist.php:7
$context
$context
Definition:
webdav.php:25
HTMLPurifier_URIFilter
Chainable filters for custom URI processing.
Definition:
URIFilter.php:28
$config
$config
Definition:
bootstrap.php:15
HTMLPurifier_URIFilter_HostBlacklist\$name
$name
string
Definition:
HostBlacklist.php:12
HTMLPurifier_URIFilter_HostBlacklist\prepare
prepare($config)
Definition:
HostBlacklist.php:23
php
HTMLPurifier_URIFilter_HostBlacklist\$blacklist
$blacklist
array
Definition:
HostBlacklist.php:17
HTMLPurifier_URIFilter_HostBlacklist\filter
filter(&$uri, $config, $context)
Definition:
HostBlacklist.php:35
libs
composer
vendor
ezyang
htmlpurifier
library
HTMLPurifier
URIFilter
HostBlacklist.php
Generated on Thu Jan 16 2025 19:01:39 for ILIAS by
1.8.13 (using
Doxyfile
)