2006-08-14 23:11:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
// this MUST be placed in post, as it assumes that any value in dir is valid
|
|
|
|
|
2006-08-20 21:55:28 +00:00
|
|
|
/**
|
|
|
|
* Post-trasnform that ensures that bdo tags have the dir attribute set.
|
|
|
|
*/
|
2006-08-14 23:11:28 +00:00
|
|
|
class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
|
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
/**
|
|
|
|
* @param array $attr
|
|
|
|
* @param HTMLPurifier_Config $config
|
|
|
|
* @param HTMLPurifier_Context $context
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function transform($attr, $config, $context)
|
|
|
|
{
|
|
|
|
if (isset($attr['dir'])) {
|
|
|
|
return $attr;
|
|
|
|
}
|
2009-02-20 00:17:49 +00:00
|
|
|
$attr['dir'] = $config->get('Attr.DefaultTextDir');
|
2006-08-17 20:29:34 +00:00
|
|
|
return $attr;
|
2006-08-14 23:11:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|