-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdrupal-core-leboat-office-cookie.patch
35 lines (33 loc) · 1.31 KB
/
drupal-core-leboat-office-cookie.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
diff --git a/includes/bootstrap.inc b/includes/bootstrap.inc
index 80563ef..efab0e1 100644
--- a/includes/bootstrap.inc
+++ b/includes/bootstrap.inc
@@ -1023,7 +1023,11 @@ function drupal_page_get_cache($check_only = FALSE) {
}
if (drupal_page_is_cacheable()) {
- $cache = cache_get($base_root . request_uri(), 'cache_page');
+ $office_cookie = ':none';
+ if (isset($_COOKIE) && isset($_COOKIE['Drupal_lb_agents_site_office'])) {
+ $office_cookie = ':' . $_COOKIE['Drupal_lb_agents_site_office'];
+ }
+ $cache = cache_get($base_root . request_uri() . $office_cookie, 'cache_page');
if ($cache !== FALSE) {
$cache_hit = TRUE;
}
diff --git a/includes/common.inc b/includes/common.inc
index 31923f2..5841eb8 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5170,8 +5170,12 @@ function drupal_page_set_cache() {
global $base_root;
if (drupal_page_is_cacheable()) {
+ $office_cookie = ':none';
+ if (isset($_COOKIE) && isset($_COOKIE['Drupal_lb_agents_site_office'])) {
+ $office_cookie = ':' . $_COOKIE['Drupal_lb_agents_site_office'];
+ }
$cache = (object) array(
- 'cid' => $base_root . request_uri(),
+ 'cid' => $base_root . request_uri() . $office_cookie,
'data' => array(
'path' => $_GET['q'],
'body' => ob_get_clean(),