Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
64143182
Commit
64143182
authored
Dec 05, 2014
by
Nathaniel Catchpole
Browse files
Issue
#2386255
by aneek, rpayanm: Remove explicit sha1() call in drupal_page_cache_get_cid()
parent
dedaf33c
Changes
5
Hide whitespace changes
Inline
Side-by-side
core/includes/bootstrap.inc
View file @
64143182
...
...
@@ -307,7 +307,7 @@ function drupal_page_cache_get_cid(Request $request) {
$request
->
getUri
(),
\
Drupal
::
service
(
'content_negotiation'
)
->
getContentType
(
$request
),
);
return
sha1
(
implode
(
':'
,
$cid_parts
)
)
;
return
implode
(
':'
,
$cid_parts
);
}
/**
...
...
core/modules/block/src/Tests/BlockTest.php
View file @
64143182
...
...
@@ -323,7 +323,7 @@ public function testBlockCacheTags() {
$this
->
drupalGet
(
'<front>'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'HIT'
);
$cid_parts
=
array
(
\
Drupal
::
url
(
'<front>'
,
array
(),
array
(
'absolute'
=>
TRUE
)),
'html'
);
$cid
=
sha1
(
implode
(
':'
,
$cid_parts
)
)
;
$cid
=
implode
(
':'
,
$cid_parts
);
$cache_entry
=
\
Drupal
::
cache
(
'render'
)
->
get
(
$cid
);
$expected_cache_tags
=
array
(
'theme:classy'
,
...
...
@@ -365,7 +365,7 @@ public function testBlockCacheTags() {
$this
->
drupalGet
(
'<front>'
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'HIT'
);
$cid_parts
=
array
(
\
Drupal
::
url
(
'<front>'
,
array
(),
array
(
'absolute'
=>
TRUE
)),
'html'
);
$cid
=
sha1
(
implode
(
':'
,
$cid_parts
)
)
;
$cid
=
implode
(
':'
,
$cid_parts
);
$cache_entry
=
\
Drupal
::
cache
(
'render'
)
->
get
(
$cid
);
$expected_cache_tags
=
array
(
'theme:classy'
,
...
...
core/modules/system/src/Tests/Bootstrap/PageCacheTest.php
View file @
64143182
...
...
@@ -58,7 +58,7 @@ function testPageCacheTags() {
$this
->
drupalGet
(
$path
);
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'HIT'
);
$cid_parts
=
array
(
\
Drupal
::
url
(
'system_test.cache_tags_page'
,
array
(),
array
(
'absolute'
=>
TRUE
)),
'html'
);
$cid
=
sha1
(
implode
(
':'
,
$cid_parts
)
)
;
$cid
=
implode
(
':'
,
$cid_parts
);
$cache_entry
=
\
Drupal
::
cache
(
'render'
)
->
get
(
$cid
);
sort
(
$cache_entry
->
tags
);
$expected_tags
=
array
(
...
...
core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
View file @
64143182
...
...
@@ -150,7 +150,7 @@ protected function verifyPageCacheTags($path, $expected_tags) {
$this
->
assertEqual
(
$this
->
drupalGetHeader
(
'X-Drupal-Cache'
),
'HIT'
);
$this
->
assertIdentical
(
$actual_tags
,
$expected_tags
);
$cid_parts
=
array
(
_url
(
$path
,
array
(
'absolute'
=>
TRUE
)),
'html'
);
$cid
=
sha1
(
implode
(
':'
,
$cid_parts
)
)
;
$cid
=
implode
(
':'
,
$cid_parts
);
$cache_entry
=
\
Drupal
::
cache
(
'render'
)
->
get
(
$cid
);
sort
(
$cache_entry
->
tags
);
$this
->
assertEqual
(
$cache_entry
->
tags
,
$expected_tags
);
...
...
core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
View file @
64143182
...
...
@@ -54,7 +54,7 @@ protected function verifyPageCache($path, $hit_or_miss, $tags = FALSE) {
if
(
$hit_or_miss
===
'HIT'
&&
is_array
(
$tags
))
{
$cid_parts
=
array
(
_url
(
$path
,
array
(
'absolute'
=>
TRUE
)),
'html'
);
$cid
=
sha1
(
implode
(
':'
,
$cid_parts
)
)
;
$cid
=
implode
(
':'
,
$cid_parts
);
$cache_entry
=
\
Drupal
::
cache
(
'render'
)
->
get
(
$cid
);
sort
(
$cache_entry
->
tags
);
$tags
=
array_unique
(
$tags
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment