aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2014-02-21 15:43:14 +0100
committerNicolas LÅ“uillet <nicolas.loeuillet@gmail.com>2014-02-21 15:43:14 +0100
commitd4949327efa15b492cab1bef3fe074290a328a17 (patch)
treee89e0322bb1f1b06d663fd10fdded21bac867e5d /inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php
parentc9bd17a1007bb78e5de0775efca01df0fb515031 (diff)
downloadwallabag-d4949327efa15b492cab1bef3fe074290a328a17.tar.gz
wallabag-d4949327efa15b492cab1bef3fe074290a328a17.tar.zst
wallabag-d4949327efa15b492cab1bef3fe074290a328a17.zip
[add] HTML Purifier added to clean code
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php')
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php
new file mode 100644
index 00000000..a220a6ad
--- /dev/null
+++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/URIScheme/file.php
@@ -0,0 +1,44 @@
1<?php
2
3/**
4 * Validates file as defined by RFC 1630 and RFC 1738.
5 */
6class HTMLPurifier_URIScheme_file extends HTMLPurifier_URIScheme
7{
8 /**
9 * Generally file:// URLs are not accessible from most
10 * machines, so placing them as an img src is incorrect.
11 * @type bool
12 */
13 public $browsable = false;
14
15 /**
16 * Basically the *only* URI scheme for which this is true, since
17 * accessing files on the local machine is very common. In fact,
18 * browsers on some operating systems don't understand the
19 * authority, though I hear it is used on Windows to refer to
20 * network shares.
21 * @type bool
22 */
23 public $may_omit_host = true;
24
25 /**
26 * @param HTMLPurifier_URI $uri
27 * @param HTMLPurifier_Config $config
28 * @param HTMLPurifier_Context $context
29 * @return bool
30 */
31 public function doValidate(&$uri, $config, $context)
32 {
33 // Authentication method is not supported
34 $uri->userinfo = null;
35 // file:// makes no provisions for accessing the resource
36 $uri->port = null;
37 // While it seems to work on Firefox, the querystring has
38 // no possible effect and is thus stripped.
39 $uri->query = null;
40 return true;
41 }
42}
43
44// vim: et sw=4 sts=4