summaryrefslogtreecommitdiff
path: root/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme')
-rw-r--r--modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php43
-rw-r--r--modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/http.php20
-rw-r--r--modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/https.php12
-rw-r--r--modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/mailto.php27
-rw-r--r--modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/news.php22
-rw-r--r--modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php20
6 files changed, 0 insertions, 144 deletions
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php
deleted file mode 100644
index 5849bf7f..00000000
--- a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/ftp.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-
-/**
- * Validates ftp (File Transfer Protocol) URIs as defined by generic RFC 1738.
- */
-class HTMLPurifier_URIScheme_ftp extends HTMLPurifier_URIScheme {
-
- public $default_port = 21;
- public $browsable = true; // usually
- public $hierarchical = true;
-
- public function validate(&$uri, $config, $context) {
- parent::validate($uri, $config, $context);
- $uri->query = null;
-
- // typecode check
- $semicolon_pos = strrpos($uri->path, ';'); // reverse
- if ($semicolon_pos !== false) {
- $type = substr($uri->path, $semicolon_pos + 1); // no semicolon
- $uri->path = substr($uri->path, 0, $semicolon_pos);
- $type_ret = '';
- if (strpos($type, '=') !== false) {
- // figure out whether or not the declaration is correct
- list($key, $typecode) = explode('=', $type, 2);
- if ($key !== 'type') {
- // invalid key, tack it back on encoded
- $uri->path .= '%3B' . $type;
- } elseif ($typecode === 'a' || $typecode === 'i' || $typecode === 'd') {
- $type_ret = ";type=$typecode";
- }
- } else {
- $uri->path .= '%3B' . $type;
- }
- $uri->path = str_replace(';', '%3B', $uri->path);
- $uri->path .= $type_ret;
- }
-
- return true;
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/http.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/http.php
deleted file mode 100644
index b097a31d..00000000
--- a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/http.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-/**
- * Validates http (HyperText Transfer Protocol) as defined by RFC 2616
- */
-class HTMLPurifier_URIScheme_http extends HTMLPurifier_URIScheme {
-
- public $default_port = 80;
- public $browsable = true;
- public $hierarchical = true;
-
- public function validate(&$uri, $config, $context) {
- parent::validate($uri, $config, $context);
- $uri->userinfo = null;
- return true;
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/https.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/https.php
deleted file mode 100644
index 29e38091..00000000
--- a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/https.php
+++ /dev/null
@@ -1,12 +0,0 @@
-<?php
-
-/**
- * Validates https (Secure HTTP) according to http scheme.
- */
-class HTMLPurifier_URIScheme_https extends HTMLPurifier_URIScheme_http {
-
- public $default_port = 443;
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/mailto.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/mailto.php
deleted file mode 100644
index c1e2cd5a..00000000
--- a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/mailto.php
+++ /dev/null
@@ -1,27 +0,0 @@
-<?php
-
-// VERY RELAXED! Shouldn't cause problems, not even Firefox checks if the
-// email is valid, but be careful!
-
-/**
- * Validates mailto (for E-mail) according to RFC 2368
- * @todo Validate the email address
- * @todo Filter allowed query parameters
- */
-
-class HTMLPurifier_URIScheme_mailto extends HTMLPurifier_URIScheme {
-
- public $browsable = false;
-
- public function validate(&$uri, $config, $context) {
- parent::validate($uri, $config, $context);
- $uri->userinfo = null;
- $uri->host = null;
- $uri->port = null;
- // we need to validate path against RFC 2368's addr-spec
- return true;
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/news.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/news.php
deleted file mode 100644
index f5f54f4f..00000000
--- a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/news.php
+++ /dev/null
@@ -1,22 +0,0 @@
-<?php
-
-/**
- * Validates news (Usenet) as defined by generic RFC 1738
- */
-class HTMLPurifier_URIScheme_news extends HTMLPurifier_URIScheme {
-
- public $browsable = false;
-
- public function validate(&$uri, $config, $context) {
- parent::validate($uri, $config, $context);
- $uri->userinfo = null;
- $uri->host = null;
- $uri->port = null;
- $uri->query = null;
- // typecode check needed on path
- return true;
- }
-
-}
-
-// vim: et sw=4 sts=4
diff --git a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php b/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php
deleted file mode 100644
index 5bf93ea7..00000000
--- a/modules/gallery/libraries/HTMLPurifier/HTMLPurifier/URIScheme/nntp.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-
-/**
- * Validates nntp (Network News Transfer Protocol) as defined by generic RFC 1738
- */
-class HTMLPurifier_URIScheme_nntp extends HTMLPurifier_URIScheme {
-
- public $default_port = 119;
- public $browsable = false;
-
- public function validate(&$uri, $config, $context) {
- parent::validate($uri, $config, $context);
- $uri->userinfo = null;
- $uri->query = null;
- return true;
- }
-
-}
-
-// vim: et sw=4 sts=4