summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--includes/database/database.inc2
-rw-r--r--modules/simpletest/simpletest.test2
2 files changed, 2 insertions, 2 deletions
diff --git a/includes/database/database.inc b/includes/database/database.inc
index f1185c77a..20b8ba5b5 100644
--- a/includes/database/database.inc
+++ b/includes/database/database.inc
@@ -1358,7 +1358,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'])) {
+ if (isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/^simpletest\d+$/", $_SERVER['HTTP_USER_AGENT'])) {
$db_prefix .= $_SERVER['HTTP_USER_AGENT'];
}
return $new_connection;
diff --git a/modules/simpletest/simpletest.test b/modules/simpletest/simpletest.test
index 45d2d15b4..a26dce0d4 100644
--- a/modules/simpletest/simpletest.test
+++ b/modules/simpletest/simpletest.test
@@ -260,7 +260,7 @@ class SimpleTestFunctionalTest extends DrupalWebTestCase {
* @return The test is being run from inside a CURL request.
*/
function inCURL() {
- return preg_match("/^simpletest\d+/", $_SERVER['HTTP_USER_AGENT']);
+ return isset($_SERVER['HTTP_USER_AGENT']) && preg_match("/^simpletest\d+/", $_SERVER['HTTP_USER_AGENT']);
}
}