From fa94c66c92eaec0a636fa4f92b8496f7c38fc54a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Sat, 1 Nov 2008 21:21:35 +0000 Subject: - Patch #328719 by c960657: make the module list tests succeed again. --- includes/common.inc | 4 ++-- includes/database/database.inc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'includes') 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 -- cgit v1.2.3