|
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 |
|
@@ -1628,7 +1628,7 @@ function ValidateKey(&$test, &$error, $key = null) |
1628 | 1628 | ) { |
1629 | 1629 | $test['location'] = $keys[$key]['default location']; |
1630 | 1630 | } |
1631 | | - $api_priority = intval(GetSetting('api_priority', 5)); |
| 1631 | + $api_priority = intval(GetSetting('api_priority', 7)); |
1632 | 1632 | $test['priority'] = $api_priority; |
1633 | 1633 | if (isset($keys[$key]['priority'])) { |
1634 | 1634 | $test['priority'] = intval($keys[$key]['priority']); |
@@ -1719,9 +1719,8 @@ function ValidateKey(&$test, &$error, $key = null) |
1719 | 1719 | // Store the account info with the test |
1720 | 1720 | $test['accountId'] = $account['accountId']; |
1721 | 1721 | $test['contactId'] = $account['contactId']; |
1722 | | - // success. See if there is a priority override for redis-based API tests |
1723 | | - if (Util::getSetting('paid_priority')) { |
1724 | | - $test['priority'] = intval(Util::getSetting('paid_priority')); |
| 1722 | + if (Util::getSetting('api_priority')) { |
| 1723 | + $test['priority'] = intval(Util::getSetting('api_priority')); |
1725 | 1724 | } |
1726 | 1725 | } else { |
1727 | 1726 | $error = 'The test request will exceed the remaining test balance for the given API key'; |
@@ -1827,9 +1826,24 @@ function ValidateParameters(&$test, $locations, &$error, $destination_url = null |
1827 | 1826 |
|
1828 | 1827 | // make sure on/off options are explicitly 1 or 0 |
1829 | 1828 | $values = array( |
1830 | | - 'private', 'web10', 'ignoreSSL', 'tcpdump', 'standards', 'lighthouse', |
1831 | | - 'timeline', 'swrender', 'netlog', 'spdy3', 'noscript', 'fullsizevideo', |
1832 | | - 'blockads', 'sensitive', 'pngss', 'bodies', 'htmlbody', 'pss_advanced', |
| 1829 | + 'private', |
| 1830 | + 'web10', |
| 1831 | + 'ignoreSSL', |
| 1832 | + 'tcpdump', |
| 1833 | + 'standards', |
| 1834 | + 'lighthouse', |
| 1835 | + 'timeline', |
| 1836 | + 'swrender', |
| 1837 | + 'netlog', |
| 1838 | + 'spdy3', |
| 1839 | + 'noscript', |
| 1840 | + 'fullsizevideo', |
| 1841 | + 'blockads', |
| 1842 | + 'sensitive', |
| 1843 | + 'pngss', |
| 1844 | + 'bodies', |
| 1845 | + 'htmlbody', |
| 1846 | + 'pss_advanced', |
1833 | 1847 | 'noheaders' |
1834 | 1848 | ); |
1835 | 1849 | foreach ($values as $value) { |
@@ -3555,7 +3569,7 @@ function CheckRateLimit($test, &$error, &$errorTitle) |
3555 | 3569 |
|
3556 | 3570 | $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>"; |
3557 | 3571 | $errorTitleTemplate = "You've reached the limit for"; |
3558 | | - |
| 3572 | + |
3559 | 3573 | if (!$passesMonthly) { |
3560 | 3574 | $errorTitle = "{$errorTitleTemplate} this month"; |
3561 | 3575 | $error = $errorTemplate; |
|
0 commit comments