foreach ($this->add_attributes
as $tag =>
$valuePairs) { $this->
add_attr($tag,
$valuePairs,
$document);
} } // Replace relative URLs
$this->base =
$base;
foreach ($this->replace_url_attributes
as $element =>
$attributes) { $this->
replace_urls($document,
$element,
$attributes);
} // If image handling (caching, etc.) is enabled, cache and rewrite all the image tags.
if (isset($this->image_handler
) && ((string) $this->image_handler
) !== '' &&
$this->enable_cache
) { $images =
$document->
getElementsByTagName('img'
);
foreach ($images as $img) { if ($img->
hasAttribute('src'
)) { $image_url =
call_user_func($this->cache_name_function,
$img->
getAttribute('src'
));