Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
6aea1d08
Commit
6aea1d08
authored
Jun 24, 2008
by
Dries Buytaert
Browse files
Options
Downloads
Patches
Plain Diff
- Patch
#260778
by boombatower et al: play a user agent trick to make the tests work.
parent
5efec92a
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
includes/common.inc
+11
-0
11 additions, 0 deletions
includes/common.inc
with
11 additions
and
0 deletions
includes/common.inc
+
11
−
0
View file @
6aea1d08
...
...
@@ -414,6 +414,7 @@ function drupal_access_denied() {
* data and redirect status.
*/
function
drupal_http_request
(
$url
,
$headers
=
array
(),
$method
=
'GET'
,
$data
=
NULL
,
$retry
=
3
)
{
global
$db_prefix
;
static
$self_test
=
FALSE
;
$result
=
new
stdClass
();
// Try to clear the drupal_http_request_fails variable if it's set. We
...
...
@@ -482,6 +483,16 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data =
$defaults
[
'Authorization'
]
=
'Authorization: Basic '
.
base64_encode
(
$uri
[
'user'
]
.
(
!
empty
(
$uri
[
'pass'
])
?
":"
.
$uri
[
'pass'
]
:
''
));
}
// If the database prefix is being used by SimpleTest to run the tests in a copied
// database then set the user-agent header to the database prefix so that any
// calls to other Drupal pages will run the SimpleTest prefixed database. The
// user-agent is used to ensure that multiple testing sessions running at the
// same time won't interfere with each other as they would if the database
// prefix were stored statically in a file or database variable.
if
(
preg_match
(
"/^simpletest\d+/"
,
$db_prefix
))
{
$headers
[
'User-Agent'
]
=
$db_prefix
;
}
foreach
(
$headers
as
$header
=>
$value
)
{
$defaults
[
$header
]
=
$header
.
': '
.
$value
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment