mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 17:01:51 +00:00
9d390fca56
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@163 48356398-32a2-884e-a903-53898d9a118a
25 lines
564 B
PHP
25 lines
564 B
PHP
<?php
|
|
|
|
require_once 'HTMLPurifier/AttrTransform.php';
|
|
|
|
class HTMLPurifier_AttrTransform_Lang extends HTMLPurifier_AttrTransform
|
|
{
|
|
|
|
function transform($attr) {
|
|
|
|
$lang = isset($attr['lang']) ? $attr['lang'] : false;
|
|
$xml_lang = isset($attr['xml:lang']) ? $attr['xml:lang'] : false;
|
|
|
|
if ($lang !== false && $xml_lang === false) {
|
|
$attr['xml:lang'] = $lang;
|
|
} elseif ($xml_lang !== false) {
|
|
$attr['lang'] = $xml_lang;
|
|
}
|
|
|
|
return $attr;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|