Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F849205
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Apr 20, 4:00 PM
Size
2 KB
Mime Type
text/x-diff
Expires
Tue, Apr 22, 4:00 PM (21 h, 14 m)
Engine
blob
Format
Raw Data
Handle
603722
Attached To
rINP In-Portal
in-portal
View Options
Index: branches/5.0.x/core/kernel/utility/debugger/debugger_responce.php
===================================================================
--- branches/5.0.x/core/kernel/utility/debugger/debugger_responce.php (revision 12281)
+++ branches/5.0.x/core/kernel/utility/debugger/debugger_responce.php (revision 12282)
@@ -1,76 +1,76 @@
<?php
/**
* @version $Id$
* @package In-Portal
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license GNU/GPL
* In-Portal is Open Source software.
* This means that this software may have been modified pursuant
* the GNU General Public License, and as distributed it includes
* or is derivative of works licensed under the GNU General Public License
* or other free or open source software licenses.
* See http://www.in-portal.net/license/ for copyright notices and details.
*/
ini_set('memory_limit', -1);
set_time_limit(0);
define('FULL_PATH', realpath(dirname(__FILE__).'/../../../..') );
$sid = $_GET['sid'];
- $path = isset($_GET['path']) ? $_GET['path'] : '/kernel/cache';
+ $path = isset($_GET['path']) ? $_GET['path'] : '/system/cache';
if ((strpos($path, '../') !== false) || (trim($path) !== $path)) {
// when relative paths or special chars are found template names from url, then it's hacking attempt
exit;
}
if (!preg_match('/^@([\d]+)@$/', $sid)) exit;
$debug_file = FULL_PATH.$path.'/debug_'.$sid.'.txt';
if (file_exists($debug_file)) {
$ret = file_get_contents($debug_file);
$ret = str_replace('#DBG_FILESIZE#', formatSize( filesize($debug_file) ), $ret);
unlink($debug_file);
}
else {
$ret = 'file not found';
}
if (function_exists('gzencode') && strstr($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip')) {
header('Content-Encoding: gzip');
echo gzencode($ret);
}
else {
echo $ret;
}
/**
* Formats file/memory size in nice way
*
* @param int $bytes
* @return string
* @access public
*/
function formatSize($bytes)
{
if ($bytes >= 1099511627776) {
$return = round($bytes / 1024 / 1024 / 1024 / 1024, 2);
$suffix = "TB";
} elseif ($bytes >= 1073741824) {
$return = round($bytes / 1024 / 1024 / 1024, 2);
$suffix = "GB";
} elseif ($bytes >= 1048576) {
$return = round($bytes / 1024 / 1024, 2);
$suffix = "MB";
} elseif ($bytes >= 1024) {
$return = round($bytes / 1024, 2);
$suffix = "KB";
} else {
$return = $bytes;
$suffix = "Byte";
}
$return .= ' '.$suffix;
return $return;
}
?>
\ No newline at end of file
Event Timeline
Log In to Comment