|
146 | 146 | } |
147 | 147 | if (array_key_exists('resubmit', $_POST)) { |
148 | 148 | $test = GetTestInfo(trim($_POST['resubmit'])); |
149 | | - if (array_key_exists('key', $test)){ |
| 149 | + if (array_key_exists('key', $test)) { |
150 | 150 | $test['key'] = null; |
151 | 151 | } |
152 | 152 | if ($test) { |
|
221 | 221 | $is_private = 0; |
222 | 222 |
|
223 | 223 | $is_private_api_call = !empty($user_api_key) && !empty($req_private) && |
224 | | - ((int)$req_private == 1 || $req_private == 'true'); |
| 224 | + ((int)$req_private == 1 || $req_private == 'true'); |
225 | 225 | $is_private_web_call = $isPaid && ($_POST['private'] == 'on'); |
226 | 226 |
|
227 | 227 | if ($is_private_api_call || $is_private_web_call) { |
|
671 | 671 | if ((isset($test['batch']) && $test['batch']) || (isset($test['batch_locations']) && $test['batch_locations'])) { |
672 | 672 | $test['priority'] = intval(GetSetting('bulk_priority', 7)); |
673 | 673 | } elseif ($_SERVER['REQUEST_METHOD'] == 'GET' || $xml || $json) { |
674 | | - $test['priority'] = intval(GetSetting('api_priority', 5)); |
| 674 | + $test['priority'] = intval(GetSetting('api_priority', 7)); |
675 | 675 | } |
676 | 676 | } |
677 | 677 |
|
@@ -1635,7 +1635,7 @@ function ValidateKey(&$test, &$error, $key = null) |
1635 | 1635 | ) { |
1636 | 1636 | $test['location'] = $keys[$key]['default location']; |
1637 | 1637 | } |
1638 | | - $api_priority = intval(GetSetting('api_priority', 5)); |
| 1638 | + $api_priority = intval(GetSetting('api_priority', 7)); |
1639 | 1639 | $test['priority'] = $api_priority; |
1640 | 1640 | if (isset($keys[$key]['priority'])) { |
1641 | 1641 | $test['priority'] = intval($keys[$key]['priority']); |
@@ -1726,9 +1726,8 @@ function ValidateKey(&$test, &$error, $key = null) |
1726 | 1726 | // Store the account info with the test |
1727 | 1727 | $test['accountId'] = $account['accountId']; |
1728 | 1728 | $test['contactId'] = $account['contactId']; |
1729 | | - // success. See if there is a priority override for redis-based API tests |
1730 | | - if (Util::getSetting('paid_priority')) { |
1731 | | - $test['priority'] = intval(Util::getSetting('paid_priority')); |
| 1729 | + if (Util::getSetting('api_priority')) { |
| 1730 | + $test['priority'] = intval(Util::getSetting('api_priority')); |
1732 | 1731 | } |
1733 | 1732 | } else { |
1734 | 1733 | $error = 'The test request will exceed the remaining test balance for the given API key'; |
@@ -1834,9 +1833,24 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null |
1834 | 1833 |
|
1835 | 1834 | // make sure on/off options are explicitly 1 or 0 |
1836 | 1835 | $values = array( |
1837 | | - 'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse', |
1838 | | - 'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo', |
1839 | | - 'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced', |
| 1836 | + 'private', |
| 1837 | + 'web10', |
| 1838 | + 'ignoreSSL', |
| 1839 | + 'tcpdump', |
| 1840 | + 'standards', |
| 1841 | + 'lighthouse', |
| 1842 | + 'timeline', |
| 1843 | + 'swrender', |
| 1844 | + 'netlog', |
| 1845 | + 'spdy3', |
| 1846 | + 'noscript', |
| 1847 | + 'fullsizevideo', |
| 1848 | + 'blockads', |
| 1849 | + 'sensitive', |
| 1850 | + 'pngss', |
| 1851 | + 'bodies', |
| 1852 | + 'htmlbody', |
| 1853 | + 'pss_advanced', |
1840 | 1854 | 'noheaders' |
1841 | 1855 | ); |
1842 | 1856 | foreach ($values as $value) { |
@@ -3562,7 +3576,7 @@ function CheckRateLimit($test, &$error, &$errorTitle) |
3562 | 3576 |
|
3563 | 3577 | $errorTemplate = "<p>Don't worry! You can keep testing for free once you log in, which will give you access to other excellent features like:</p>"; |
3564 | 3578 | $errorTitleTemplate = "You've reached the limit for"; |
3565 | | - |
| 3579 | + |
3566 | 3580 | if (!$passesMonthly) { |
3567 | 3581 | $errorTitle = "{$errorTitleTemplate} this month"; |
3568 | 3582 | $error = $errorTemplate; |
|
0 commit comments