You are here

private function CasValidator::parseAllowedProxyChains in CAS 8

Same name and namespace in other branches
  1. 2.x src/Service/CasValidator.php \Drupal\cas\Service\CasValidator::parseAllowedProxyChains()

Parse the proxy chain config into a usable data structure.

Parameters

string $proxy_chains: A newline-delimited list of allowed proxy chains.

Return value

array An array of allowed proxy chains, each containing an array of regular expressions for a URL in the chain.

1 call to CasValidator::parseAllowedProxyChains()
CasValidator::verifyProxyChain in src/Service/CasValidator.php
Verify a proxy chain from the CAS Server.

File

src/Service/CasValidator.php, line 376

Class

CasValidator
Class CasValidator.

Namespace

Drupal\cas\Service

Code

private function parseAllowedProxyChains($proxy_chains) {
  $chain_list = [];

  // Split configuration string on vertical whitespace.
  $chains = preg_split('/\\v/', $proxy_chains, NULL, PREG_SPLIT_NO_EMPTY);

  // Loop through chains, splitting out each URL.
  foreach ($chains as $chain) {

    // Split chain string on any whitespace character.
    $list = preg_split('/\\s/', $chain, NULL, PREG_SPLIT_NO_EMPTY);
    $chain_list[] = $list;
  }
  return $chain_list;
}