if i make ajax call by XMLHttpRequest
echo ('SOME TEXT SOME TEXT SOME TEXT SOME TEXT SOME TEXT SOME TEXT SOME TEXT ')
$app->close(); // exit with code 0
but XMLHttpRequest->responseText <----- SOME TEXT SOME TEXT SOME TEXT SOME TEXT SOME TEXT SOME TEXT SOME TEXT
but XMLHttpRequest->responseText <----- EMPTY
EasyPHP on Window11
PHP 8.3.13
project dir: D:\My Documents\my Projects\name_project
\libraries\vendor\joomla\application\src\AbstractApplication.php ->
public function close($code = 0)
{
if (!$code) error_clear_last(); // i suggest add this line -------------------- ***** suggest ***** OPTION 1
exit($code);
}
when call $app->close() exit(0) call;
because in \libraries\bootstrap.php
has code
$errorHandler = \Symfony\Component\ErrorHandler\ErrorHandler::register();
so call to
\libraries\vendor\symfony\error-handler.php -> handleFatalError()
but handleFatalError() has no way to exit with code 0;
Last line in handleFatalError():
if ($exit && $exitCode = self::$exitCode) {
register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); });
}
----- I suggest: ----- <<<<<<<<<< <<<<<<<<<< <<<<<<<<<< OPTION 2
if ($exit) {
$exitCode = self::$exitCode
register_shutdown_function('register_shutdown_function', function () use ($exitCode) { exit($exitCode); });
}
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
Title |
|
Labels |
Added:
Information Required
|
I am unable to replicate this.