From 5b602ef36f84617b6197daa4d69b515a3d325759 Mon Sep 17 00:00:00 2001 From: mmorris Date: Thu, 23 Jul 2015 06:23:59 -0400 Subject: [PATCH] Original runtime assertion --- .htaccess | 2 +- core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.htaccess b/.htaccess index 73ce26b..476f23f 100644 --- a/.htaccess +++ b/.htaccess @@ -35,7 +35,7 @@ AddEncoding gzip svgz # PHP 5, Apache 1 and 2. - php_value assert.active 0 + php_value assert.active 1 php_flag session.auto_start off php_value mbstring.http_input pass php_value mbstring.http_output pass diff --git a/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php index 4bf3459..9891fd2 100644 --- a/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php +++ b/core/lib/Drupal/Core/Cache/Context/CacheContextsManager.php @@ -107,6 +107,8 @@ public function getLabels($include_calculated_cache_contexts = FALSE) { * Thrown if any of the context tokens or parameters are not valid. */ public function convertTokensToKeys(array $context_tokens) { + assert('\\Drupal\\Component\\Assertion\\Inspector::assertAllStrings($context_tokens)'); + $this->validateTokens($context_tokens); $cacheable_metadata = new CacheableMetadata(); $optimized_tokens = $this->optimizeTokens($context_tokens); @@ -124,7 +126,6 @@ public function convertTokensToKeys(array $context_tokens) { list($context_id, $parameter) = $context; $keys[] = $this->getService($context_id)->getContext($parameter); } - // Create the returned object and merge in the cacheability metadata. $context_cache_keys = new ContextCacheKeys($keys); return $context_cache_keys->merge($cacheable_metadata); -- 1.8.4.2