You are here

protected function SimpleFbConnectPostLoginManager::validateInternalPath in Simple FB Connect 8.3

Same name and namespace in other branches
  1. 8.2 src/SimpleFbConnectPostLoginManager.php \Drupal\simple_fb_connect\SimpleFbConnectPostLoginManager::validateInternalPath()

Checks that given path is valid internal Drupal path.

Returned path includes subfolder as path prefix if Drupal is installed to a subfolder.

Parameters

string $path: Path to validate.

Return value

string|bool Path to redirect the user if $path was valid. False otherwise

1 call to SimpleFbConnectPostLoginManager::validateInternalPath()
SimpleFbConnectPostLoginManager::getPostLoginPath in src/SimpleFbConnectPostLoginManager.php
Returns the path the user should be redirected after a successful login.

File

src/SimpleFbConnectPostLoginManager.php, line 152

Class

SimpleFbConnectPostLoginManager
Contains all logic that is related to post login redirects.

Namespace

Drupal\simple_fb_connect

Code

protected function validateInternalPath($path) {
  $url = $this->pathValidator
    ->getUrlIfValid($path);
  if ($url !== FALSE && $url
    ->isExternal() === FALSE) {
    return $url
      ->toString();
  }
  return FALSE;
}