mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-18 14:58:43 +02:00
⚡ Add Echoing for all pages KPI
This commit is contained in:
@@ -38,22 +38,22 @@ class CSVPage extends WebPage
|
||||
|
||||
public function output()
|
||||
{
|
||||
$this->add_header("Content-Length: ".strlen(trim($this->s_content)));
|
||||
$this->add_header("Content-Length: ".strlen(trim($this->s_content)));
|
||||
|
||||
// Get the unexpected output but do nothing with it
|
||||
$sTrash = $this->ob_get_clean_safe();
|
||||
// Get the unexpected output but do nothing with it
|
||||
$sTrash = $this->ob_get_clean_safe();
|
||||
|
||||
foreach($this->a_headers as $s_header)
|
||||
{
|
||||
header($s_header);
|
||||
}
|
||||
echo trim($this->s_content);
|
||||
echo "\n";
|
||||
$oKpi = new ExecutionKPI();
|
||||
foreach ($this->a_headers as $s_header) {
|
||||
header($s_header);
|
||||
}
|
||||
echo trim($this->s_content);
|
||||
echo "\n";
|
||||
$oKpi->ComputeAndReport('Echoing ('.round(strlen($this->s_content) / 1024).' Kb)');
|
||||
|
||||
if (class_exists('DBSearch'))
|
||||
{
|
||||
DBSearch::RecordQueryTrace();
|
||||
}
|
||||
if (class_exists('DBSearch')) {
|
||||
DBSearch::RecordQueryTrace();
|
||||
}
|
||||
if (class_exists('ExecutionKPI')) {
|
||||
ExecutionKPI::ReportStats();
|
||||
}
|
||||
|
||||
@@ -44,9 +44,12 @@ class DownloadPage extends AjaxPage
|
||||
|
||||
if (($this->sContentType == 'text/html') && ($this->sContentDisposition == 'inline')) {
|
||||
// inline content != attachment && html => filter all scripts for malicious XSS scripts
|
||||
echo self::FilterXSS($this->sContent);
|
||||
$sContent = self::FilterXSS($this->sContent);
|
||||
} else {
|
||||
echo $this->sContent;
|
||||
$sContent = $this->sContent;
|
||||
}
|
||||
$oKpi = new ExecutionKPI();
|
||||
echo $sContent;
|
||||
$oKpi->ComputeAndReport('Echoing ('.round(strlen($sContent) / 1024).' Kb)');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,7 +92,10 @@ class JsonPage extends WebPage
|
||||
'scripts' => $aScripts,
|
||||
];
|
||||
|
||||
echo json_encode($aJson);
|
||||
$oKpi = new ExecutionKPI();
|
||||
$sJSON = json_encode($aJson);
|
||||
echo $sJSON;
|
||||
$oKpi->ComputeAndReport('Echoing ('.round(strlen($sJSON) / 1024).' Kb)');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user