private function isAllowedPath($path) {
    $unallowed_paths = [
      '/user/logout',
      '/ajax',
    ];
    foreach ($unallowed_paths as $unallowed_path) {
      if ($unallowed_path === substr($path, 0, strlen($unallowed_path))) {
        return FALSE;
      }
    }
    return TRUE;
  }
private function isAllowedPath($path) {
    $unallowed_paths = [
      '/user/logout',
      '/ajax',
    ];
    foreach ($unallowed_paths as $unallowed_path) {
      if ($unallowed_path === substr($path, 0, strlen($unallowed_path))) {
        return FALSE;
      }
    }
    return TRUE;
  }
private function isAllowedPath ( $ path ) { $ unallowed_paths = [ '/user/logout' , '/ajax' , ] ; foreach ( $ unallowed_paths as $ unallowed_path ) { if ( $ unallowed_path === substr ( $ path , 0 , strlen ( $ unallowed_path ) ) ) { return FALSE ; } } return TRUE ; }
Checks if a path is allowed.

Some paths are not allowed, e.g. /user/logout or /ajax.

@param string $path
Path to check.

@return bool
Returns true when path is allowed.
Checks if a path is allowed .