You are here

private function CasValidator::parseAllowedProxyChains in CAS 2.x

Same name and namespace in other branches
  1. 8 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
The CAS ticket validator service.

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