public function AjaxBasePageNegotiator8b7c:f320:99b9:690f:4595:cd17:293a:c069termineActiveTheme public AjaxBasePageNegotiator8b7c:f320:99b9:690f:4595:cd17:293a:c069termineActiveTheme(RouteMatchInterface $route_match) Determine the active theme for the request. Parameters  \Drupal\Core\Routing\RouteMatchInterface $route_match: The current route match object. Return value  string|null The name of the theme, or NULL if other negotiators, like the configured default one, should be used instead. Overrides ThemeNegotiatorInter8b7c:f320:99b9:690f:4595:cd17:293a:c069determineActiveTheme File
 core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php, line 79  Class
 
AjaxBasePageNegotiator  Defines a theme negotiator that deals with the active theme on ajax requests.  Namespace Drupal\Core\Theme Code public function determineActiveTheme(RouteMatchInterface $route_match) {
  if (($ajax_page_state = $this->requestStack->getCurrentRequest()->request->get('ajax_page_state')) && !empty($ajax_page_state['theme']) && !empty($ajax_page_state['theme_token'])) {
    $theme = $ajax_page_state['theme'];
    $token = $ajax_page_state['theme_token'];

    // Prevent a request forgery from giving a person access to a theme they
    // shouldn't be otherwise allowed to see. However, since everyone is
    // allowed to see the default theme, token validation isn't required for
    // that, and bypassing it allows most use-cases to work even when accessed
    // from the page cache.
    if ($theme === $this->configFactory->get('system.theme')->get('default') || $this->csrfGenerator->validate($token, $theme)) {
      return $theme;
    }
  }
}


    
{'path': 'public/docs/drupal~8/core-lib-drupal-core-theme-ajaxbasepagenegotiator.php/function/ajaxbasepagenegotiator-determineactivetheme/8.1.x.html', 'source': 'DevDocs.IO'}