Use separate debug files and prevent direct access

This commit is contained in:
Kijin Sung 2016-02-13 21:11:05 +09:00
parent 51f985c215
commit 4e2535624d
3 changed files with 12 additions and 4 deletions

View file

@ -209,8 +209,16 @@ class DisplayHandler extends Handler
$content = ob_get_clean();
if ($display_type === 'file')
{
$debug_file = RX_BASEDIR . 'files/_debug_message.php';
FileHandler::writeFile($debug_file, $content, 'a');
$debug_file = RX_BASEDIR . 'files/debug/' . getInternalDateTime(RX_TIME, 'Ymd') . '.php';
if (!file_exists($debug_file) || !filesize($debug_file))
{
$phpheader = '<?php exit; ?>' . "\n";
}
else
{
$phpheader = '';
}
FileHandler::writeFile($debug_file, $phpheader . $content, 'a');
return '';
}
else