You are here

public function PagesRestrictionHelper::getRestrictedPagesByConfig in Pages Restriction Access 8

Get Restricted Pages by Config.

File

src/Service/PagesRestrictionHelper.php, line 15

Class

PagesRestrictionHelper
Helper for Pages Restriction.

Namespace

Drupal\pages_restriction\Service

Code

public function getRestrictedPagesByConfig($configRestrictedPages) {
  if (empty($configRestrictedPages)) {
    return FALSE;
  }
  $restrictedPages = [];
  foreach ($configRestrictedPages as $restrictedPage) {
    $restrictedPage = explode('|', $restrictedPage);
    if (empty($restrictedPage)) {
      continue;
    }
    $restrictedPath = Xss::filter($restrictedPage[0]);
    $restrictedPath = trim($restrictedPath);
    $restrictedPages[] = $restrictedPath;
  }
  return $restrictedPages;
}