You are here

protected function Dbug::xmlDefaultHandler in dBug for Drupal 8

Same name and namespace in other branches
  1. 2.0.x src/Dbug.php \Drupal\dbug\Dbug::xmlDefaultHandler()
  2. 1.0.x src/Dbug.php \Drupal\dbug\Dbug::xmlDefaultHandler()

Xml: initiated when a comment or other miscellaneous texts is encountered.

Parameters

string $parser: The parser.

string $data: The data.

File

src/Dbug.php, line 694

Class

Dbug
Implementation of dBug for Drupal.

Namespace

Drupal\dbug

Code

protected function xmlDefaultHandler($parser, $data) {

  // Strip '<!--' and '-->' off comments.
  $data = str_replace([
    "&lt;!--",
    "--&gt;",
  ], "", htmlspecialchars($data));
  $count = $this->xmlCount - 1;
  if (!empty($this->xmlDData[$count])) {
    $this->xmlDData[$count] .= $data;
  }
  else {
    $this->xmlDData[$count] = $data;
  }
}