mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-19 21:03:54 -07:00
Removed isAJAX check [So buggy] (#675)
This commit is contained in:
parent
9281ba84cf
commit
045297eb6d
3 changed files with 2 additions and 16 deletions
|
@ -145,7 +145,6 @@ define('SEARCH_TYPE_TRACKER', 1);
|
||||||
// Ajax error codes
|
// Ajax error codes
|
||||||
define('E_AJAX_GENERAL_ERROR', 1000);
|
define('E_AJAX_GENERAL_ERROR', 1000);
|
||||||
define('E_AJAX_NEED_LOGIN', 1001);
|
define('E_AJAX_NEED_LOGIN', 1001);
|
||||||
define('E_AJAX_NOT_REQUEST', 1002);
|
|
||||||
|
|
||||||
// Private messaging
|
// Private messaging
|
||||||
define('PRIVMSGS_READ_MAIL', 0);
|
define('PRIVMSGS_READ_MAIL', 0);
|
||||||
|
|
|
@ -75,13 +75,10 @@ class Ajax
|
||||||
// Check that requested action is valid
|
// Check that requested action is valid
|
||||||
$action = $this->action;
|
$action = $this->action;
|
||||||
|
|
||||||
// Action params
|
// Actions params array
|
||||||
$action_params = null;
|
$action_params = null;
|
||||||
|
|
||||||
if (!IsHelper::isAJAX()) {
|
// Actions check
|
||||||
$this->ajax_die('Not AJAX request', E_AJAX_NOT_REQUEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!$action) {
|
if (!$action) {
|
||||||
$this->ajax_die('no action specified');
|
$this->ajax_die('no action specified');
|
||||||
} elseif (!$action_params =& $this->valid_actions[$action]) {
|
} elseif (!$action_params =& $this->valid_actions[$action]) {
|
||||||
|
|
|
@ -31,16 +31,6 @@ class IsHelper
|
||||||
return $_is_php[$version];
|
return $_is_php[$version];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return true if ajax request
|
|
||||||
*
|
|
||||||
* @return bool
|
|
||||||
*/
|
|
||||||
public static function isAJAX(): bool
|
|
||||||
{
|
|
||||||
return (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return true if server have SSL
|
* Return true if server have SSL
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue