2006-08-12 01:12:35 +00:00
|
|
|
<?php
|
|
|
|
|
2006-08-20 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* Validator for the components of a URI for a specific scheme
|
|
|
|
*/
|
2006-08-12 01:12:35 +00:00
|
|
|
class HTMLPurifier_URIScheme
|
|
|
|
{
|
|
|
|
|
2006-08-20 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* Scheme's default port (integer)
|
|
|
|
* @public
|
|
|
|
*/
|
2006-08-12 18:58:54 +00:00
|
|
|
var $default_port = null;
|
|
|
|
|
2006-08-20 20:59:13 +00:00
|
|
|
/**
|
|
|
|
* Validates the components of a URI
|
|
|
|
* @note This implementation should be called by children if they define
|
|
|
|
* a default port, as it does port processing.
|
|
|
|
* @note Fragment is omitted as that is scheme independent
|
|
|
|
* @param $userinfo User info found before at sign in authority
|
|
|
|
* @param $host Hostname in authority
|
|
|
|
* @param $port Port found after colon in authority
|
|
|
|
* @param $path Path of URI
|
|
|
|
* @param $query Query of URI, found after question mark
|
|
|
|
* @param $config HTMLPurifier_Config object
|
|
|
|
*/
|
2006-08-12 18:58:54 +00:00
|
|
|
function validateComponents(
|
|
|
|
$userinfo, $host, $port, $path, $query, $config
|
|
|
|
) {
|
|
|
|
if ($this->default_port == $port) $port = null;
|
|
|
|
return array($userinfo, $host, $port, $path, $query);
|
2006-08-12 01:12:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|