mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-03 07:13:59 +01:00
Format tidy in preview loader only
This commit is contained in:
@@ -3,31 +3,32 @@
|
||||
include("headers.php");
|
||||
include("settings.php");
|
||||
|
||||
$file = str_replace("|","/",xssClean($_GET['file'],'html'));
|
||||
$file = str_replace("|", "/", xssClean($_GET['file'], 'html'));
|
||||
|
||||
// Get contents
|
||||
$loadedFile = toUTF8noBOM(getData("../data/backups/".$file),true);
|
||||
$encoding=ini_get("default_charset");
|
||||
if($encoding=="")
|
||||
$encoding="UTF-8";
|
||||
$loadedFile = toUTF8noBOM(getData("../data/backups/" . $file), true);
|
||||
$encoding = ini_get("default_charset");
|
||||
if ($encoding == "") {
|
||||
$encoding = "UTF-8";
|
||||
}
|
||||
|
||||
// Set content in a textarea
|
||||
echo '<textarea name="loadedFile" id="loadedFile">'.htmlentities($loadedFile,ENT_COMPAT,$encoding).'</textarea>';
|
||||
echo '<textarea name="loadedFile" id="loadedFile">' . htmlentities($loadedFile, ENT_COMPAT, $encoding) . '</textarea>';
|
||||
|
||||
// Get bytes for this file
|
||||
$bytes = filesize("../data/backups/".$file);
|
||||
$bytes = filesize("../data/backups/" . $file);
|
||||
// Change into kilobytes
|
||||
$outputSize = ($bytes/1024);
|
||||
$outputSize = ($bytes / 1024);
|
||||
$outputUnit = "kb";
|
||||
// Maybe we should show in megabytes?
|
||||
if ($outputSize >= 1024) {
|
||||
$outputSize = ($outputSize/1024);
|
||||
$outputSize = ($outputSize / 1024);
|
||||
$outputUnit = "mb";
|
||||
}
|
||||
$size = number_format($outputSize, 2, '.', '').$outputUnit." (".number_format($bytes)." bytes)";
|
||||
$size = number_format($outputSize, 2, '.', '') . $outputUnit . " (" . number_format($bytes) . " bytes)";
|
||||
|
||||
// Get date & time of file
|
||||
$datetime = str_replace("-","<br>",date( "D jS M Y-g:i:sa", filemtime("../data/backups/".$file)));
|
||||
$datetime = str_replace("-", "<br>", date("D jS M Y-g:i:sa", filemtime("../data/backups/" . $file)));
|
||||
?>
|
||||
<script>
|
||||
parent.document.getElementById('buttonsContainer').style.display = 'inline-block';
|
||||
|
||||
Reference in New Issue
Block a user