You are here

public static function Securepages::matchCurrentPath in Secure Pages 8

Match the current path against the configured settings.

Return value

bool|NULL

  • FALSE: Path should be non-secure.
  • TRUE: Path should be secure.
  • NULL: No explicit information.
2 calls to Securepages::matchCurrentPath()
Securepages::checkRedirect in src/Securepages.php
Checks the current request and see if we need to redirect.
SecurepagesSubscriber::checkResponseRedirection in src/EventSubscriber/SecurepagesSubscriber.php
Event handler for response processing. Alters redirects if needed.

File

src/Securepages.php, line 77
Contains \Drupal\securepages\Securepages.

Class

Securepages
Utility class for global functionality.

Namespace

Drupal\securepages

Code

public static function matchCurrentPath() {
  $request = \Drupal::requestStack()
    ->getCurrentRequest();

  /** @var \Drupal\Core\Path\CurrentPathStack $current_path */
  $current_path_stack = \Drupal::service('path.current');
  return Securepages::matchPath($current_path_stack
    ->getPath($request));
}