Skip to content

Commit ce90c2e

Browse files
committed
Disable redirect checking for bulk tests
1 parent 633126c commit ce90c2e

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

www/runtest.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ function DealWithMagicQuotes(&$arr) {
5050
if (array_key_exists('headless', $settings) && $settings['headless']) {
5151
$headless = true;
5252
}
53+
$is_bulk_test = false;
5354

5455
// Load the location information
5556
$locations = LoadLocationsIni();
@@ -477,8 +478,10 @@ function DealWithMagicQuotes(&$arr) {
477478
// see if it is a batch test
478479
$test['batch'] = 0;
479480
if( (isset($req_bulkurls) && strlen($req_bulkurls)) ||
480-
(isset($_FILES['bulkfile']) && isset($_FILES['bulkfile']['tmp_name']) && strlen($_FILES['bulkfile']['tmp_name'])) )
481+
(isset($_FILES['bulkfile']) && isset($_FILES['bulkfile']['tmp_name']) && strlen($_FILES['bulkfile']['tmp_name'])) ) {
481482
$test['batch'] = 1;
483+
$is_bulk_test = true;
484+
}
482485

483486
// login tests are forced to be private
484487
if( isset($test['login']) && strlen($test['login']) )
@@ -1953,6 +1956,7 @@ function CheckUrl($url)
19531956
global $usingAPI;
19541957
global $error;
19551958
global $admin;
1959+
global $is_bulk_test;
19561960
$date = gmdate("Ymd");
19571961
if( strncasecmp($url, 'http:', 5) && strncasecmp($url, 'https:', 6))
19581962
$url = 'http://' . $url;
@@ -1964,7 +1968,7 @@ function CheckUrl($url)
19641968
// Follow redirects to see if they are obscuring the site being tested
19651969
$rhost = '';
19661970
$rurl = '';
1967-
if (GetSetting('check_redirects'))
1971+
if (GetSetting('check_redirects') && !$is_bulk_test)
19681972
GetRedirect($url, $rhost, $rurl);
19691973
foreach( $blockUrls as $block ) {
19701974
$block = trim($block);
@@ -2001,7 +2005,7 @@ function CheckUrl($url)
20012005
}
20022006
}
20032007

2004-
if ($ok && !$admin && !$usingAPI) {
2008+
if ($ok && !$admin && !$usingAPI && !$is_bulk_test) {
20052009
$ok = SBL_Check($url, $message);
20062010
if (!$ok) {
20072011
$error = "<br>Sorry, your test was blocked because " . htmlspecialchars($url) . " is suspected of being used for

0 commit comments

Comments
 (0)