From 045297eb6d6769de0eb9a679ba4fe535dda1a704 Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Sat, 8 Apr 2023 00:16:55 +0700 Subject: [PATCH] Removed isAJAX check [So buggy] (#675) --- library/includes/init_bb.php | 1 - src/Ajax.php | 7 ++----- src/Helpers/IsHelper.php | 10 ---------- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/library/includes/init_bb.php b/library/includes/init_bb.php index e56a7bdc9..eb00cfa86 100644 --- a/library/includes/init_bb.php +++ b/library/includes/init_bb.php @@ -145,7 +145,6 @@ define('SEARCH_TYPE_TRACKER', 1); // Ajax error codes define('E_AJAX_GENERAL_ERROR', 1000); define('E_AJAX_NEED_LOGIN', 1001); -define('E_AJAX_NOT_REQUEST', 1002); // Private messaging define('PRIVMSGS_READ_MAIL', 0); diff --git a/src/Ajax.php b/src/Ajax.php index 2df39c93c..abb505895 100644 --- a/src/Ajax.php +++ b/src/Ajax.php @@ -75,13 +75,10 @@ class Ajax // Check that requested action is valid $action = $this->action; - // Action params + // Actions params array $action_params = null; - if (!IsHelper::isAJAX()) { - $this->ajax_die('Not AJAX request', E_AJAX_NOT_REQUEST); - } - + // Actions check if (!$action) { $this->ajax_die('no action specified'); } elseif (!$action_params =& $this->valid_actions[$action]) { diff --git a/src/Helpers/IsHelper.php b/src/Helpers/IsHelper.php index fa81566bc..45001c9cb 100644 --- a/src/Helpers/IsHelper.php +++ b/src/Helpers/IsHelper.php @@ -31,16 +31,6 @@ class IsHelper 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 *