Mercurial > hg > isophonics-drupal-site
view core/modules/toolbar/src/PageCache/AllowToolbarPath.php @ 11:bfffd8d7479a
Move drupal/core from "replace" to "require" section, to ensure Composer updates it
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:51:18 +0000 |
parents | 4c8ae668cc8c |
children |
line wrap: on
line source
<?php namespace Drupal\toolbar\PageCache; use Drupal\Core\PageCache\RequestPolicyInterface; use Symfony\Component\HttpFoundation\Request; /** * Cache policy for the toolbar page cache service. * * This policy allows caching of requests directed to /toolbar/subtrees/{hash} * even for authenticated users. */ class AllowToolbarPath implements RequestPolicyInterface { /** * {@inheritdoc} */ public function check(Request $request) { // Note that this regular expression matches the end of pathinfo in order to // support multilingual sites using path prefixes. if (preg_match('#/toolbar/subtrees/[^/]+(/[^/]+)?$#', $request->getPathInfo())) { return static::ALLOW; } } }