File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
<?php
2
- // $Id: common.inc,v 1.928 2009-07-03 19:21:54 dries Exp $
2
+ // $Id: common.inc,v 1.929 2009-07-04 14:49:31 dries Exp $
3
3
4
4
/**
5
5
* @file
@@ -552,7 +552,7 @@ function drupal_http_request($url, array $options = array()) {
552
552
// user-agent is used to ensure that multiple testing sessions running at the
553
553
// same time won't interfere with each other as they would if the database
554
554
// prefix were stored statically in a file or database variable.
555
- if (preg_match ("/simpletest\d+/ " , $ db_prefix , $ matches )) {
555
+ if (is_string ( $ db_prefix ) && preg_match ("/^ simpletest\d+/ " , $ db_prefix , $ matches )) {
556
556
$ options ['headers ' ]['User-Agent ' ] = $ matches [0 ];
557
557
}
558
558
@@ -809,7 +809,7 @@ function _drupal_log_error($error, $fatal = FALSE) {
809
809
810
810
// When running inside the testing framework, we relay the errors
811
811
// to the tested site by the way of HTTP headers.
812
- if (preg_match ("/^simpletest\d+/ " , $ _SERVER ['HTTP_USER_AGENT ' ]) && !headers_sent () && (!defined ('SIMPLETEST_COLLECT_ERRORS ' ) || SIMPLETEST_COLLECT_ERRORS )) {
812
+ if (isset ( $ _SERVER [ ' HTTP_USER_AGENT ' ]) && preg_match ("/^simpletest\d+$ / " , $ _SERVER ['HTTP_USER_AGENT ' ]) && !headers_sent () && (!defined ('SIMPLETEST_COLLECT_ERRORS ' ) || SIMPLETEST_COLLECT_ERRORS )) {
813
813
// $number does not use drupal_static as it should not be reset
814
814
// as it uniquely identifies each PHP error.
815
815
static $ number = 0 ;
Original file line number Diff line number Diff line change 1
1
<?php
2
- // $Id: install.php,v 1.181 2009-06-30 21:44:06 dries Exp $
2
+ // $Id: install.php,v 1.182 2009-07-04 14:49:31 dries Exp $
3
3
4
4
/**
5
5
* Root directory of Drupal installation.
@@ -28,7 +28,7 @@ function install_main() {
28
28
// The user agent header is used to pass a database prefix in the request when
29
29
// running tests. However, for security reasons, it is imperative that no
30
30
// installation be permitted using such a prefix.
31
- if (preg_match ("/^simpletest\d+$/ " , $ _SERVER ['HTTP_USER_AGENT ' ])) {
31
+ if (isset ( $ _SERVER [ ' HTTP_USER_AGENT ' ]) && preg_match ("/^simpletest\d+$/ " , $ _SERVER ['HTTP_USER_AGENT ' ])) {
32
32
header ($ _SERVER ['SERVER_PROTOCOL ' ] . ' 403 Forbidden ' );
33
33
exit ;
34
34
}
You can’t perform that action at this time.
0 commit comments