diff options
Diffstat (limited to 'includes')
-rw-r--r-- | includes/common.inc | 4 | ||||
-rw-r--r-- | includes/database/database.inc | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/includes/common.inc b/includes/common.inc index 7b2dda038..df2b8e1d2 100644 --- a/includes/common.inc +++ b/includes/common.inc @@ -497,8 +497,8 @@ function drupal_http_request($url, $headers = array(), $method = 'GET', $data = // 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; + if (preg_match("/simpletest\d+/", $db_prefix, $matches)) { + $headers['User-Agent'] = $matches[0]; } foreach ($headers as $header => $value) { diff --git a/includes/database/database.inc b/includes/database/database.inc index 0f64dfb61..31d98b4b3 100644 --- a/includes/database/database.inc +++ b/includes/database/database.inc @@ -1005,7 +1005,7 @@ abstract class Database { // We need to pass around the simpletest database prefix in the request // and we put that in the user_agent header. if (preg_match("/^simpletest\d+$/", $_SERVER['HTTP_USER_AGENT'])) { - $db_prefix = $_SERVER['HTTP_USER_AGENT']; + $db_prefix .= $_SERVER['HTTP_USER_AGENT']; } // Return the target that was actually opened in case the requested one |