Skip to content
Snippets Groups Projects
Commit db962b54 authored by Christian Kuhn's avatar Christian Kuhn
Browse files

[TASK] Release typo3/ajax.php from early t3lib_div usage

ajax.php entry script requires t3lib_div very early to use a single
method from it. This is ugly, so the needed code is now implemented
in ajax.php directly, removing the requirement to include t3lib_div
so early.

Change-Id: I974c39c185872ab68bdc7732434c4bc52d77f75f
Resolves: #46269
Release: 6.1
Reviewed-on: https://review.typo3.org/18903
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent ea6c098b
Branches
Tags
No related merge requests found
......@@ -24,16 +24,15 @@
*
* This copyright notice MUST APPEAR in all copies of the script!
***************************************************************/
/**
* AJAX dispatcher
*
* @author Benjamin Mack <mack@xnos.org>
*/
$TYPO3_AJAX = TRUE;
// Include t3lib_div at this time to get the GET/POST methods it provides
require_once dirname(__FILE__) . '/../t3lib/class.t3lib_div.php';
// First get the ajaxID
$ajaxID = (string) \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('ajaxID');
// This is a list of requests that don't necessarily need a valid BE user
$noUserAjaxIDs = array(
'BackendLogin::login',
......@@ -42,11 +41,20 @@ $noUserAjaxIDs = array(
'BackendLogin::isTimedOut',
'BackendLogin::getChallenge'
);
// First get the ajaxID
$ajaxID = isset($_POST['ajaxID']) ? $_POST['ajaxID'] : $_GET['ajaxID'];
if (isset($ajaxID)) {
$ajaxID = (string)stripslashes($ajaxID);
}
// If we're trying to do an ajax login, don't require a user.
if (in_array($ajaxID, $noUserAjaxIDs)) {
define('TYPO3_PROCEED_IF_NO_USER', 2);
}
require 'init.php';
// finding the script path from the variable
$ajaxScript = $TYPO3_CONF_VARS['BE']['AJAX'][$ajaxID];
// Instantiating the AJAX object
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment