You are here

protected function Entry::collectXhtml in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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

Entry

Namespace

Zend\Feed\Reader\Extension\Atom

Code

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;
}