]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Allow gopher: scheme in link href
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Mar 2016 02:39:02 +0000 (03:39 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 6 Mar 2016 02:39:34 +0000 (03:39 +0100)
plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php [new file with mode: 0644]

diff --git a/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php b/plugins/HTMLPurifierSchemes/lib/htmlpurifier/urischeme/gopher.php
new file mode 100644 (file)
index 0000000..735ea62
--- /dev/null
@@ -0,0 +1,36 @@
+<?php
+
+/**
+ * Validates gopher
+ */
+class HTMLPurifier_URIScheme_gopher extends HTMLPurifier_URIScheme
+{
+    /**
+     * @type int
+     */
+    public $default_port = 70;
+
+    /**
+     * @type bool
+     */
+    public $browsable = true;
+
+    /**
+     * @type bool
+     */
+    public $hierarchical = true;
+
+    /**
+     * @param HTMLPurifier_URI $uri
+     * @param HTMLPurifier_Config $config
+     * @param HTMLPurifier_Context $context
+     * @return bool
+     */
+    public function doValidate(&$uri, $config, $context)
+    {
+        $uri->userinfo = null;
+        return true;
+    }
+}
+
+// vim: et sw=4 sts=4