aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/3rdparty/htmlpurifier/HTMLPurifier/AttrTransform/BdoDir.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/3rdparty/htmlpurifier/HTMLPurifier/AttrTransform/BdoDir.php')
-rw-r--r--inc/3rdparty/htmlpurifier/HTMLPurifier/AttrTransform/BdoDir.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/inc/3rdparty/htmlpurifier/HTMLPurifier/AttrTransform/BdoDir.php b/inc/3rdparty/htmlpurifier/HTMLPurifier/AttrTransform/BdoDir.php
new file mode 100644
index 00000000..86dcb17e
--- /dev/null
+++ b/inc/3rdparty/htmlpurifier/HTMLPurifier/AttrTransform/BdoDir.php
@@ -0,0 +1,27 @@
1<?php
2
3// this MUST be placed in post, as it assumes that any value in dir is valid
4
5/**
6 * Post-trasnform that ensures that bdo tags have the dir attribute set.
7 */
8class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
9{
10
11 /**
12 * @param array $attr
13 * @param HTMLPurifier_Config $config
14 * @param HTMLPurifier_Context $context
15 * @return array
16 */
17 public function transform($attr, $config, $context)
18 {
19 if (isset($attr['dir'])) {
20 return $attr;
21 }
22 $attr['dir'] = $config->get('Attr.DefaultTextDir');
23 return $attr;
24 }
25}
26
27// vim: et sw=4 sts=4