2007-02-04 16:35:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XHTML 1.1 Image Module provides basic image embedding.
|
2007-02-04 20:09:35 +00:00
|
|
|
* @note There is specialized code for removing empty images in
|
|
|
|
* HTMLPurifier_Strategy_RemoveForeignElements
|
2007-02-04 16:35:40 +00:00
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
|
|
|
|
2007-11-25 02:24:39 +00:00
|
|
|
public $name = 'Image';
|
2007-02-04 16:35:40 +00:00
|
|
|
|
2007-11-29 04:29:51 +00:00
|
|
|
public function __construct() {
|
2007-05-12 20:44:47 +00:00
|
|
|
$img =& $this->addElement(
|
2007-05-09 22:01:07 +00:00
|
|
|
'img', true, 'Inline', 'Empty', 'Common',
|
|
|
|
array(
|
2007-06-20 21:39:28 +00:00
|
|
|
'alt*' => 'Text',
|
2007-05-09 22:01:07 +00:00
|
|
|
'height' => 'Length',
|
|
|
|
'longdesc' => 'URI',
|
2007-06-20 21:39:28 +00:00
|
|
|
'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded
|
2007-05-09 22:01:07 +00:00
|
|
|
'width' => 'Length'
|
|
|
|
)
|
2007-02-04 16:35:40 +00:00
|
|
|
);
|
2007-06-20 21:39:28 +00:00
|
|
|
// kind of strange, but splitting things up would be inefficient
|
|
|
|
$img->attr_transform_pre[] =
|
2007-05-12 20:44:47 +00:00
|
|
|
$img->attr_transform_post[] =
|
2007-02-04 16:35:40 +00:00
|
|
|
new HTMLPurifier_AttrTransform_ImgRequired();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|