Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
425a1f95
Commit
425a1f95
authored
Aug 20, 2009
by
webchick
Browse files
#554106
by dropcube: Attempt
#2
at fixing random test failures.
parent
5a4fdae4
Changes
1
Hide whitespace changes
Inline
Side-by-side
includes/bootstrap.inc
View file @
425a1f95
...
...
@@ -1552,10 +1552,8 @@ function drupal_valid_test_ua($user_agent) {
// The file properties add more entropy not easily accessible to others.
$filepath
=
DRUPAL_ROOT
.
'/includes/bootstrap.inc'
;
$key
=
sha1
(
serialize
(
$databases
)
.
filectime
(
$filepath
)
.
fileinode
(
$filepath
),
TRUE
);
$time_diff
=
REQUEST_TIME
-
$time
;
// Since we are making a local request, a 2 second time window is allowed,
// and the HMAC must match.
return
((
$time_diff
>=
0
)
&&
(
$time_diff
<
3
)
&&
(
$hmac
==
base64_encode
(
hash_hmac
(
'sha1'
,
$check_string
,
$key
,
TRUE
))));
// The HMAC must match.
return
$hmac
==
base64_encode
(
hash_hmac
(
'sha1'
,
$check_string
,
$key
,
TRUE
));
}
/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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