Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / URIScheme.php
blob41c02f70d2dba65e003746a64b7cf95ddef7333e
1 <?php
3 /**
4 * Validator for the components of a URI for a specific scheme
5 */
6 class HTMLPurifier_URIScheme
9 /**
10 * Scheme's default port (integer)
11 * @public
13 var $default_port = null;
15 /**
16 * Whether or not URIs of this schem are locatable by a browser
17 * http and ftp are accessible, while mailto and news are not.
18 * @public
20 var $browsable = false;
22 /**
23 * Whether or not the URI always uses <hier_part>, resolves edge cases
24 * with making relative URIs absolute
26 var $hierarchical = false;
28 /**
29 * Validates the components of a URI
30 * @note This implementation should be called by children if they define
31 * a default port, as it does port processing.
32 * @param $uri Instance of HTMLPurifier_URI
33 * @param $config HTMLPurifier_Config object
34 * @param $context HTMLPurifier_Context object
35 * @return Bool success or failure
37 function validate(&$uri, $config, &$context) {
38 if ($this->default_port == $uri->port) $uri->port = null;
39 return true;