mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-11 03:04:09 +02:00
[feature/request-class] Add server(), header() and is_ajax() to request
Extend the request class with helpers for reading server vars (server()) and HTTP request headers (header()). Refactor the existing code base to make use of these helpers, make $_SERVER a deactivated super global. Also introduce an is_ajax() method, which checks the X-Requested-With header for the value 'XMLHttpRequest', which is sent by JavaScript libraries, such as jQuery. PHPBB3-9716
This commit is contained in:
@@ -41,7 +41,8 @@ class phpbb_recaptcha extends phpbb_default_captcha
|
||||
// PHP4 Constructor
|
||||
function phpbb_recaptcha()
|
||||
{
|
||||
$this->recaptcha_server = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? $this->recaptcha_server_secure : $this->recaptcha_server;
|
||||
global $request;
|
||||
$this->recaptcha_server = $request->server('HTTPS') == 'on' ? $this->recaptcha_server_secure : $this->recaptcha_server;
|
||||
}
|
||||
|
||||
function init($type)
|
||||
|
Reference in New Issue
Block a user