mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-11 21:12:15 +09:00
Remove debug data from previous request (causes memory overage in PHP 8.0)
This commit is contained in:
parent
ae163b95d4
commit
1289776c97
2 changed files with 0 additions and 21 deletions
|
|
@ -244,26 +244,11 @@ class DisplayHandler extends Handler
|
||||||
case 'HTML':
|
case 'HTML':
|
||||||
$json_options = defined('JSON_PRETTY_PRINT') ? (JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 0;
|
$json_options = defined('JSON_PRETTY_PRINT') ? (JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) : 0;
|
||||||
$panel_script = sprintf('<script src="%s%s?%s"></script>', RX_BASEURL, 'common/js/debug.js', filemtime(RX_BASEDIR . 'common/js/debug.js'));
|
$panel_script = sprintf('<script src="%s%s?%s"></script>', RX_BASEURL, 'common/js/debug.js', filemtime(RX_BASEDIR . 'common/js/debug.js'));
|
||||||
if (isset($_SESSION['_rx_debug_previous']))
|
|
||||||
{
|
|
||||||
$panel_script .= "\n<script>\nvar rhymix_debug_previous = " . json_encode($_SESSION['_rx_debug_previous'], $json_options) . ";\n</script>";
|
|
||||||
unset($_SESSION['_rx_debug_previous']);
|
|
||||||
}
|
|
||||||
$panel_script .= "\n<script>\nvar rhymix_debug_content = " . json_encode($data, $json_options) . ";\n</script>";
|
$panel_script .= "\n<script>\nvar rhymix_debug_content = " . json_encode($data, $json_options) . ";\n</script>";
|
||||||
$body_end_position = strrpos($output, '</body>') ?: strlen($output);
|
$body_end_position = strrpos($output, '</body>') ?: strlen($output);
|
||||||
$output = substr($output, 0, $body_end_position) . "\n$panel_script\n" . substr($output, $body_end_position);
|
$output = substr($output, 0, $body_end_position) . "\n$panel_script\n" . substr($output, $body_end_position);
|
||||||
break;
|
break;
|
||||||
case 'JSON':
|
case 'JSON':
|
||||||
if (RX_POST && preg_match('/^proc/', Context::get('act')))
|
|
||||||
{
|
|
||||||
$data->ajax_module = Context::get('module');
|
|
||||||
$data->ajax_act = Context::get('act');
|
|
||||||
$_SESSION['_rx_debug_previous'] = $data;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
unset($_SESSION['_rx_debug_previous']);
|
|
||||||
}
|
|
||||||
if (preg_match('/^(.+)\}$/', $output, $matches))
|
if (preg_match('/^(.+)\}$/', $output, $matches))
|
||||||
{
|
{
|
||||||
$output = $matches[1] . ',"_rx_debug":' . json_encode($data) . '}';
|
$output = $matches[1] . ',"_rx_debug":' . json_encode($data) . '}';
|
||||||
|
|
|
||||||
|
|
@ -200,12 +200,6 @@ $(function() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Add debug data from the previous request.
|
|
||||||
if (window.rhymix_debug_previous) {
|
|
||||||
window.rhymix_debug_previous.page_title = 'PREVIOUS POST : ' + window.rhymix_debug_previous.ajax_module + "." + window.rhymix_debug_previous.ajax_act;
|
|
||||||
rhymix_debug_add_data(window.rhymix_debug_previous, false);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add debug data from the current request.
|
// Add debug data from the current request.
|
||||||
if (window.rhymix_debug_content) {
|
if (window.rhymix_debug_content) {
|
||||||
window.rhymix_debug_content.page_title = 'MAIN PAGE';
|
window.rhymix_debug_content.page_title = 'MAIN PAGE';
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue