protected function Entry::collectXhtml in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php \Zend\Feed\Reader\Extension\Atom\Entry::collectXhtml()
Parse out XHTML to remove the namespacing
Parameters
$xhtml:
$prefix:
Return value
mixed
1 call to Entry::collectXhtml()
- Entry::getContent in vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ Atom/ Entry.php - Get the entry content
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ Atom/ Entry.php, line 140
Class
Namespace
Zend\Feed\Reader\Extension\AtomCode
protected function collectXhtml($xhtml, $prefix) {
if (!empty($prefix)) {
$prefix = $prefix . ':';
}
$matches = [
"/<\\?xml[^<]*>[^<]*<" . $prefix . "div[^<]*/",
"/<\\/" . $prefix . "div>\\s*\$/",
];
$xhtml = preg_replace($matches, '', $xhtml);
if (!empty($prefix)) {
$xhtml = preg_replace("/(<[\\/]?)" . $prefix . "([a-zA-Z]+)/", '$1$2', $xhtml);
}
return $xhtml;
}