mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-11 08:34:29 +02:00
Add lots of documentation.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@293 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -14,10 +14,10 @@ HTMLPurifier_ConfigDef::define(
|
||||
class HTMLPurifier_AttrTransform_BdoDir extends HTMLPurifier_AttrTransform
|
||||
{
|
||||
|
||||
function transform($attributes, $config) {
|
||||
if (isset($attributes['dir'])) return $attributes;
|
||||
$attributes['dir'] = $config->get('Attr', 'DefaultTextDir');
|
||||
return $attributes;
|
||||
function transform($attr, $config) {
|
||||
if (isset($attr['dir'])) return $attributes;
|
||||
$attr['dir'] = $config->get('Attr', 'DefaultTextDir');
|
||||
return $attr;
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -22,23 +22,23 @@ HTMLPurifier_ConfigDef::define(
|
||||
class HTMLPurifier_AttrTransform_ImgRequired extends HTMLPurifier_AttrTransform
|
||||
{
|
||||
|
||||
function transform($attributes, $config) {
|
||||
function transform($attr, $config) {
|
||||
|
||||
$src = true;
|
||||
if (!isset($attributes['src'])) {
|
||||
$attributes['src'] = $config->get('Attr', 'DefaultInvalidImage');
|
||||
if (!isset($attr['src'])) {
|
||||
$attr['src'] = $config->get('Attr', 'DefaultInvalidImage');
|
||||
$src = false;
|
||||
}
|
||||
|
||||
if (!isset($attributes['alt'])) {
|
||||
if (!isset($attr['alt'])) {
|
||||
if ($src) {
|
||||
$attributes['alt'] = basename($attributes['src']);
|
||||
$attr['alt'] = basename($attr['src']);
|
||||
} else {
|
||||
$attributes['alt'] = $config->get('Attr', 'DefaultInvalidImageAlt');
|
||||
$attr['alt'] = $config->get('Attr', 'DefaultInvalidImageAlt');
|
||||
}
|
||||
}
|
||||
|
||||
return $attributes;
|
||||
return $attr;
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user