core/includes/bootstrap.inc | 5 ++++- core/modules/block/lib/Drupal/block/BlockBase.php | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc index eb4b964..7c338d8 100644 --- a/core/includes/bootstrap.inc +++ b/core/includes/bootstrap.inc @@ -974,7 +974,10 @@ function drupal_serve_page_from_cache(stdClass $cache, Response $response, Reque // max-age > 0, allowing the page to be cached by external proxies, when a // session cookie is present unless the Vary header has been replaced. $max_age = !$request->cookies->has(session_name()) || isset($boot_headers['vary']) ? $config->get('cache.page.max_age') : 0; - // Never set an expiration date further than one year into the future. + // RFC 2616, section 14.21 says: 'To mark a response as "never expires," an + // origin server sends an Expires date approximately one year from the time + // the response is sent. HTTP/1.1 servers SHOULD NOT send Expires dates more + // than one year in the future.' if ($max_age > 31536000 || $max_age === \Drupal\Core\Cache\Cache::PERMANENT) { $max_age = 31536000; } diff --git a/core/modules/block/lib/Drupal/block/BlockBase.php b/core/modules/block/lib/Drupal/block/BlockBase.php index 768dd70..99150cf 100644 --- a/core/modules/block/lib/Drupal/block/BlockBase.php +++ b/core/modules/block/lib/Drupal/block/BlockBase.php @@ -182,6 +182,9 @@ public function blockForm($form, &$form_state) { * @see \Drupal\block\BlockBase::blockValidate() */ public function validateConfigurationForm(array &$form, array &$form_state) { + // Transform the #type = checkboxes value to a numerically indexed array. + $form_state['values']['cache']['contexts'] = array_values(array_filter($form_state['values']['cache']['contexts'])); + $this->blockValidate($form, $form_state); }