Update ajax.php

This commit is contained in:
Roman Kelesidis 2023-11-02 19:40:46 +07:00
parent 1e55da19fc
commit d6fbeb6222

View File

@ -215,7 +215,10 @@ class ajax_common
{ {
$this->response['error_code'] = $error_code; $this->response['error_code'] = $error_code;
$this->response['error_msg'] = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $error_msg)); $this->response['error_msg'] = strip_tags(preg_replace('#<br\s*/?>#i', "\n", $error_msg));
if (DEBUG_AJAX_DIE)
{
$this->response['console_log'] = 'ajax die: ' . $this->debug_find_source(); $this->response['console_log'] = 'ajax die: ' . $this->debug_find_source();
}
$this->send(); $this->send();
} }
@ -340,7 +343,7 @@ class ajax_common
*/ */
function debug_find_source ($mode = '') function debug_find_source ($mode = '')
{ {
if (!SQL_PREPEND_SRC_COMM) return 'src disabled'; if (!DEBUG_AJAX_DIE) return 'src disabled';
foreach (debug_backtrace() as $trace) foreach (debug_backtrace() as $trace)
{ {
if (!empty($trace['file']) && $trace['file'] !== __FILE__) if (!empty($trace['file']) && $trace['file'] !== __FILE__)