XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
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
{
9
public
$name
=
'HostBlacklist'
;
10
protected
$blacklist
= array();
11
public
function
prepare
(
$config
) {
12
$this->blacklist =
$config
->get(
'URI.HostBlacklist'
);
13
return
true
;
14
}
15
public
function
filter
(&$uri,
$config
, $context) {
16
foreach
($this->blacklist as $blacklisted_host_fragment) {
17
if
(strpos($uri->host, $blacklisted_host_fragment) !==
false
) {
18
return
false
;
19
}
20
}
21
return
true
;
22
}
23
}
24
25
// vim: et sw=4 sts=4
L:
0xoops
xoops-2.5.6
htdocs
xoops_lib
modules
protector
library
HTMLPurifier
URIFilter
HostBlacklist.php
Generated on Fri May 10 2013 01:04:31 for XOOPS 2.5.6 by
1.8.3.1