Skip to content

Commit

Permalink
Disable redirect checking for bulk tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pmeenan committed Apr 22, 2019
1 parent 633126c commit ce90c2e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions www/runtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ function DealWithMagicQuotes(&$arr) {
if (array_key_exists('headless', $settings) && $settings['headless']) {
$headless = true;
}
$is_bulk_test = false;

// Load the location information
$locations = LoadLocationsIni();
Expand Down Expand Up @@ -477,8 +478,10 @@ function DealWithMagicQuotes(&$arr) {
// see if it is a batch test
$test['batch'] = 0;
if( (isset($req_bulkurls) && strlen($req_bulkurls)) ||
(isset($_FILES['bulkfile']) && isset($_FILES['bulkfile']['tmp_name']) && strlen($_FILES['bulkfile']['tmp_name'])) )
(isset($_FILES['bulkfile']) && isset($_FILES['bulkfile']['tmp_name']) && strlen($_FILES['bulkfile']['tmp_name'])) ) {
$test['batch'] = 1;
$is_bulk_test = true;
}

// login tests are forced to be private
if( isset($test['login']) && strlen($test['login']) )
Expand Down Expand Up @@ -1953,6 +1956,7 @@ function CheckUrl($url)
global $usingAPI;
global $error;
global $admin;
global $is_bulk_test;
$date = gmdate("Ymd");
if( strncasecmp($url, 'http:', 5) && strncasecmp($url, 'https:', 6))
$url = 'http://' . $url;
Expand All @@ -1964,7 +1968,7 @@ function CheckUrl($url)
// Follow redirects to see if they are obscuring the site being tested
$rhost = '';
$rurl = '';
if (GetSetting('check_redirects'))
if (GetSetting('check_redirects') && !$is_bulk_test)
GetRedirect($url, $rhost, $rurl);
foreach( $blockUrls as $block ) {
$block = trim($block);
Expand Down Expand Up @@ -2001,7 +2005,7 @@ function CheckUrl($url)
}
}

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

0 comments on commit ce90c2e

Please sign in to comment.