}
if ($node instanceof DOMElement) {
- $tag = strtolower($node->tagName);
+ $tag = Horde_String::lower($node->tagName);
switch ($tag) {
case 'a':
case 'body':
case 'td':
- if ($this->_imptmp['img'] &&
+ if ($this->_imptmp &&
$node->hasAttribute('background')) {
- $node->setAttribute('htmlimgblocked', $node->getAttribute('background'));
- $node->setAttribute('background', $this->_imptmp['blockimg']);
- $this->_imptmp['imgblock'] = true;
+ $val = $node->getAttribute('background');
+
+ /* Multipart/related. */
+ if (isset($this->_imptmp['cid'][$val])) {
+ $val = $this->getConfigParam('imp_contents')->urlView(null, 'view_attach', array('params' => array(
+ 'id' => $this->_imptmp['cid'][$val],
+ 'imp_img_view' => 'data'
+ )));
+ $node->setAttribute('background', $val);
+ }
+
+ /* Block images.*/
+ if ($this->_imptmp['img']) {
+ $node->setAttribute('htmlimgblocked', $val);
+ $node->setAttribute('background', $this->_imptmp['blockimg']);
+ $this->_imptmp['imgblock'] = true;
+ }
}
break;
}