XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
DisableExternal.php
Go to the documentation of this file.
1
<?php
2
3
class
HTMLPurifier_URIFilter_DisableExternal
extends
HTMLPurifier_URIFilter
4
{
5
public
$name
=
'DisableExternal'
;
6
protected
$ourHostParts
=
false
;
7
public
function
prepare
(
$config
) {
8
$our_host =
$config
->getDefinition(
'URI'
)->host;
9
if
($our_host !== null) $this->ourHostParts = array_reverse(explode(
'.'
, $our_host));
10
}
11
public
function
filter
(&$uri,
$config
, $context) {
12
if
(is_null($uri->host))
return
true
;
13
if
($this->ourHostParts ===
false
)
return
false
;
14
$host_parts = array_reverse(explode(
'.'
, $uri->host));
15
foreach
($this->ourHostParts as
$i
=> $x) {
16
if
(!isset($host_parts[
$i
]))
return
false
;
17
if
($host_parts[$i] != $this->ourHostParts[$i])
return
false
;
18
}
19
return
true
;
20
}
21
}
22
23
// vim: et sw=4 sts=4
L:
0xoops
xoops-2.5.6
htdocs
xoops_lib
modules
protector
library
HTMLPurifier
URIFilter
DisableExternal.php
Generated on Fri May 10 2013 01:04:31 for XOOPS 2.5.6 by
1.8.3.1