Bug #20843
closed
Exporting t3x file delivers wrong data
Added by Michael Riedel over 15 years ago.
Updated over 11 years ago.
Category:
Extension Manager
Description
Same issue as bug #M4068 which was closed without success. Please reactivate and merge with older bug #.
After saving the extension as .t3x file, I was not able to import it through extension manager on any other server. This actually is not related to the server, but due to the fact, that the extension manager for somewhat reason adds some blank characters at the beginning of the .t3x file. After removing the extra blanks, extension could be loaded without problems.
Attached .zip is the extension, and also within the .zip is a incorrectly saved .t3x file.
(issue imported from #M11661)
Files
Is there any reason why this issue has been set to private?
no, just because of the attachments. But I think you can unset the private statement.
Additional note on the bug - it seems that to somewhat reason every extension gets saved incorrectly, not only the attached one.
I cannot reproduce this - and I have to deal with manual export/import of extensions nearly on a daily basis.
Any special steps to do for reproducing?
OS? Up-to date libraries (aka. up-to-date system)?
I will try to debug myself. I have the feeling it is realted to some other extension or misconfiguration. Since this happens on my machine with every extension right now.
I could figure out the follwing:
in file class.em_index.php, line 2534 backup data ich echoed:
.-.-.-.-.-.-.
if (intval($this->CMD['doBackup'])==1) {
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename);
echo $backUpData;
exit;
.-.-.-.-.-.-.
$backupData contains the correct Data without blanks at the beginning. When I save the file in Firefox or IE, 8 blanks get added. Could it be it has something to do with the header? Strange.....
I was able to fix it !
by adding ob_clean() before the header() functions, it removes the blanks. So when I modify the code to:
.-.-.-.-.-.-.
if (intval($this->CMD['doBackup'])==1) {
ob_clean();
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename='.$filename);
echo $backUpData;
exit;
.-.-.-.-.-.-.
Everything works great. Do you think that might make sense?
best regards
Michael
That makes sense. Using ob_end_clean() for all existing buffers would also be fine.
I guess that some PHP scripts that have been included before have some empty spaces/linebreaks after the closing "?>" tag...
As the sample extension has been removed, I hereby set the view status to public.
- Target version deleted (
0)
- Priority changed from Should have to Could have
Well.. that's just the usual "you have whitespaces somewhere" problem.. wouldn't be wrong to clean before sending the file, as it's a weird side effect, but such problems will also occur on other places.
- Status changed from Accepted to Rejected
Extension Manager is no longer responsible for delivering t3x files, so this issue is no longer valid.
Also available in: Atom
PDF