New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ODS export: incorrect zip files time #14870
Comments
|
Hi @Enurhe , |
|
Hi @bahl24 , The issue is with the content of the produced OpenDocument file. An ODS file is practically a ZIP archive. As you can see from the example in original post the produced files in the ZIP archive has dates ranging from 1985 to 2019 - which is wrong. Reason being re-use of the $time variable in each iteration when packing files. They should all have same date. 2019-01-14 00:14:22 as per example. Here is the relevant code extracted from the code linked in original post, with comments: phpmyadmin/libraries/classes/ZipExtension.php Line 160 in adef7b6
Providing a DOS timestamp to |
|
Easiest solution would be to simply move the code on line 203 to 222 and place it before the From: phpmyadmin/libraries/classes/ZipExtension.php Line 203 in adef7b6
Down to line 222 inclusively. Even better, perhaps, add a new function named |
|
@Enurhe Hey, i think that the date and time should have been same in ods file as per me. Am I correct or wrong do let me know.. |
|
@williamdes, Hey I tried making some changes and this was the result |
|
@williamdes, Hey I did this with multiple tables |
|
@kartik1000 Can you try to use the "Zip" option in "Custom" mode please ? |
|
@williamdes Hey, I tried with zip option this time, |
|
@kartik1000 Thanks, It seems that you sent the wrong second screeshot |
|
Ok @williamdes, |
|
@williamdes, can you confirm about the above screenshot? |
|
@kartik1000 Yes, can you open a PR, could not find one for this issue :) |
|
@williamdes, Thanks a lot :) |
Signed-off-by: William Desportes <williamdes@wdes.fr>





Describe the bug
phpmyadmin/libraries/classes/ZipExtension.php
Line 200 in adef7b6
function createFile in file libraries/classes/ZipExtension.php
In the foreach loop the $time option is reused for each iteration resulting in wrong dates in archive.
First iteration is OK, but on next $time has the value of previous iteration, and thus getdate($time) result in some strange dates.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Consistent dates.
Server configuration
Not a severe bug, but none the less.
The text was updated successfully, but these errors were encountered: