You are here

protected function PanelsBreadcrumbBuilder::getTitle in Panels Breadcrumbs 8

Check if title is not token, and filtering It for security reason.

1 call to PanelsBreadcrumbBuilder::getTitle()
PanelsBreadcrumbBuilder::build in src/Breadcrumb/PanelsBreadcrumbBuilder.php
Builds the breadcrumb.

File

src/Breadcrumb/PanelsBreadcrumbBuilder.php, line 132

Class

PanelsBreadcrumbBuilder
Class PanelsBreadcrumbBuilder.

Namespace

Drupal\panels_breadcrumbs\Breadcrumb

Code

protected function getTitle($title, array $entities) {
  if (!$this->token
    ->scan($title)) {
    $title = $this
      ->t(Xss::filter($title));
  }
  else {
    $title = $this->token
      ->replace($title, $entities);
  }
  return $title;
}