<?php

require_once 'HTMLPurifier/AttrTransform.php';

// this MUST be placed in post, as it assumes that any value in dir is valid

HTMLPurifier_ConfigDef::define(
    'Attr', 'DefaultTextDir', 'ltr',
    'Defines the default text direction (ltr or rtl) of the document '.
    'being parsed.  This generally is the same as the value of the dir '.
    'attribute in HTML, or ltr if that is not specified.'
);

class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
{
    
    function transform($attr, $config) {
        if (isset($attr['dir'])) return $attr;
        $attr['dir'] = $config->get('Attr', 'DefaultTextDir');
        return $attr;
    }
    
}

?>
<?php

require_once 'HTMLPurifier/AttrTransform.php';

// this MUST be placed in post, as it assumes that any value in dir is valid

HTMLPurifier_ConfigDef::define(
    'Attr', 'DefaultTextDir', 'ltr',
    'Defines the default text direction (ltr or rtl) of the document '.
    'being parsed.  This generally is the same as the value of the dir '.
    'attribute in HTML, or ltr if that is not specified.'
);

class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
{
    
    function transform($attr, $config) {
        if (isset($attr['dir'])) return $attributes;
        $attr['dir'] = $config->get('Attr', 'DefaultTextDir');
        return $attr;
    }
    
}

?>
--- 
+++ 
@@ -15,7 +15,7 @@
 {
     
     function transform($attr, $config) {
-        if (isset($attr['dir'])) return $attributes;
+        if (isset($attr['dir'])) return $attr;
         $attr['dir'] = $config->get('Attr', 'DefaultTextDir');
         return $attr;
     }
Fix typo: $attributes to $attr.

git-svn-id: 25f448894bd6eb0cddf10ded73b4f5a7ea3203f3@296 48356398-32a2-884e-a903-53898d9a118a
