Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.x is supported too.

(no description)

File Size: 316 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

HTMLPurifier_URI:: (6 methods):
  __construct()
  getSchemeObj()
  validate()
  toString()
  isLocal()
  isBenign()


Class: HTMLPurifier_URI  - X-Ref

HTML Purifier's internal representation of a URI.

__construct($scheme, $userinfo, $host, $port, $path, $query, $fragment)   X-Ref

param: string $scheme
param: string $userinfo
param: string $host
param: int $port
param: string $path
param: string $query
param: string $fragment

getSchemeObj($config, $context)   X-Ref
Retrieves a scheme object corresponding to the URI's scheme/default

param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: HTMLPurifier_URIScheme Scheme object appropriate for validating this URI

validate($config, $context)   X-Ref
Generic validation method applicable for all schemes. May modify
this URI in order to get it into a compliant form.

param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: bool True if validation/filtering succeeds, false if failure

toString()   X-Ref
Convert URI back to string

return: string URI appropriate for output

isLocal($config, $context)   X-Ref
Returns true if this URL might be considered a 'local' URL given
the current context.  This is true when the host is null, or
when it matches the host supplied to the configuration.

Note that this does not do any scheme checking, so it is mostly
only appropriate for metadata that doesn't care about protocol
security.  isBenign is probably what you actually want.
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: bool

isBenign($config, $context)   X-Ref
Returns true if this URL should be considered a 'benign' URL,
that is:

- It is a local URL (isLocal), and
- It has a equal or better level of security
param: HTMLPurifier_Config $config
param: HTMLPurifier_Context $context
return: bool