Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(runtest): name vars to better validate scripts #2477

Merged
merged 1 commit into from
Oct 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions www/runtest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1754,11 +1754,11 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null
if (strlen($test['url']) || $test['batch']) {
if (
isset($experimentURL) && (stripos($test['url'], $experimentURL) !== false)
&& (!$admin && !$experimentsPaid)
&& (!($admin || $experiments_paid))
) {
$error = "Experiments are only available for WebPageTest Pro subscribers.";
} else {
$maxruns = (int)GetSetting('maxruns', 0);
$maxruns = (int)Util::getSetting('maxruns', 0);
if (isset($_COOKIE['maxruns']) && $_COOKIE['maxruns']) {
$maxruns = (int)$_COOKIE['maxruns'];
} elseif (isset($_REQUEST['maxruns']) && $_REQUEST['maxruns']) {
Expand All @@ -1768,7 +1768,7 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null
$maxruns = 10;
}

if (!GetSetting('fullSizeVideoOn')) {
if (!Util::getSetting('fullSizeVideoOn')) {
//overwrite the Full Size Video flag with 0 if feature disabled in the settings
$test['fullsizevideo'] = 0;
}
Expand Down Expand Up @@ -2032,7 +2032,7 @@ function ValidateScript(&$script, &$error)
//check if experiment URL is being used
if (
stripos($tokens[2], $experimentURL) !== false
&& (!$admin && !$experimentsPaid)
&& (!($admin || $experiments_paid))
) {
$error = "Experiments are only available for WebPageTest Pro subscribers.";
}
Expand All @@ -2044,7 +2044,7 @@ function ValidateScript(&$script, &$error)

$test['navigateCount'] = $navigateCount;

$maxNavigateCount = GetSetting("maxNavigateCount");
$maxNavigateCount = Util::getSetting("maxNavigateCount");
if (!$maxNavigateCount) {
$maxNavigateCount = 20;
}
Expand Down