aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2014-02-21 15:57:10 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2014-02-21 15:57:10 +0100
commit99679d06884120c57f43b44e55e03595f1f87bed (patch)
treea3f2a1aa1afdaeca1386d0c6e8a75344fd2241fb /inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
parent655214ab30ee84884dc408488b85586f36263fcb (diff)
parentd3b47e94705e17b3ba3529cbb1dc6efe69c5d2b7 (diff)
downloadwallabag-99679d06884120c57f43b44e55e03595f1f87bed.tar.gz
wallabag-99679d06884120c57f43b44e55e03595f1f87bed.tar.zst
wallabag-99679d06884120c57f43b44e55e03595f1f87bed.zip
Merge pull request #481 from wallabag/dev1.5.2
1.5.2
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php')
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
new file mode 100644
index 00000000..3ee81711
--- /dev/null
+++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/ConfigSchema/Interchange/Id.php
@@ -0,0 +1,58 @@
1<?php
2
3/**
4 * Represents a directive ID in the interchange format.
5 */
6class HTMLPurifier_ConfigSchema_Interchange_Id
7{
8
9 /**
10 * @type string
11 */
12 public $key;
13
14 /**
15 * @param string $key
16 */
17 public function __construct($key)
18 {
19 $this->key = $key;
20 }
21
22 /**
23 * @return string
24 * @warning This is NOT magic, to ensure that people don't abuse SPL and
25 * cause problems for PHP 5.0 support.
26 */
27 public function toString()
28 {
29 return $this->key;
30 }
31
32 /**
33 * @return string
34 */
35 public function getRootNamespace()
36 {
37 return substr($this->key, 0, strpos($this->key, "."));
38 }
39
40 /**
41 * @return string
42 */
43 public function getDirective()
44 {
45 return substr($this->key, strpos($this->key, ".") + 1);
46 }
47
48 /**
49 * @param string $id
50 * @return HTMLPurifier_ConfigSchema_Interchange_Id
51 */
52 public static function make($id)
53 {
54 return new HTMLPurifier_ConfigSchema_Interchange_Id($id);
55 }
56}
57
58// vim: et sw=4 sts=4