mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 03:28:45 +02:00
Spurious chars corrupting CSV download:
- factorized in WebPage as TrashUnexpectedOutput() - added early tracking and reporting into MetaModel::IncludeModule, use the new config flag 'debug_track_spurious_chars' to blame the harmful module/file. - protected export.php - removed a space at the beginning of page 'createfrommail.php' SVN:trunk[2260]
This commit is contained in:
@@ -828,11 +828,8 @@ try
|
||||
if ($oMenu instanceof DashboardMenuNode)
|
||||
{
|
||||
$oDashboard = $oMenu->GetDashboard();
|
||||
$sPreviousContent = ob_get_clean();
|
||||
if (trim($sPreviousContent) != '')
|
||||
{
|
||||
IssueLog::Error("Output already started before downloading file:\nContent was:'$sPreviousContent'\n");
|
||||
}
|
||||
|
||||
$oPage->TrashUnexpectedOutput();
|
||||
$oPage->SetContentType('text/xml');
|
||||
$oPage->SetContentDisposition('attachment', $oMenu->GetLabel().'.xml');
|
||||
$oPage->add($oDashboard->ToXml());
|
||||
@@ -907,12 +904,7 @@ function DownloadDocument(WebPage $oPage, $sClass, $id, $sAttCode, $sContentDisp
|
||||
$oDocument = $oObj->Get($sAttCode);
|
||||
if (is_object($oDocument))
|
||||
{
|
||||
// Make sure there is NO output at all before our content, otherwise the document will be corrupted
|
||||
$sPreviousContent = ob_get_clean();
|
||||
if (trim($sPreviousContent) != '')
|
||||
{
|
||||
IssueLog::Error("Output already started before downloading file:\nContent was:'$sPreviousContent'\n");
|
||||
}
|
||||
$oPage->TrashUnexpectedOutput();
|
||||
$oPage->SetContentType($oDocument->GetMimeType());
|
||||
$oPage->SetContentDisposition($sContentDisposition,$oDocument->GetFileName());
|
||||
$oPage->add($oDocument->GetData());
|
||||
@@ -923,4 +915,4 @@ function DownloadDocument(WebPage $oPage, $sClass, $id, $sAttCode, $sContentDisp
|
||||
$oPage->p($e->getMessage());
|
||||
}
|
||||
}
|
||||
?>
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user