#43908 closed defect (bug) (fixed)
Export keeps generating new .zip files on Windows installations
Reported by: | xkon | Owned by: | sergeybiryukov |
---|---|---|---|
Milestone: | 4.9.6 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Privacy | Keywords: | gdpr has-patch |
Focuses: | Cc: |
Description
In file.php
line 2146 we have update_post_meta( $request_id, '_export_file_path', $archive_pathname );
to update the filepath of the exported zip file.
In windows the file path uses \
instead of /
and they get stripped out when the update_post_meta
happens.
This results in an error when downloading / mailing the file so it always generates a new .zip file.
I've made a check by doing an $archive_pathname = str_replace( '\\', '/', $archive_pathname );
just before the update_post_meta and it works but not sure if that's the way to go.
( not sure if it's my installation only either but I've never seen it happen again and I was always working on Windows maybe it's an update_post_meta thing? )
Attachments (5)
Change History (24)
This ticket was mentioned in Slack in #gdpr-compliance by xkon. View the logs.
6 years ago
This ticket was mentioned in Slack in #gdpr-compliance by xkon. View the logs.
6 years ago
#5
@
6 years ago
This works well for the archive (ZIP) on my Mac, but I wonder if you ( @xkon ) are also having (silent) trouble on Windows with the temporary HTML report path (we write the HTML report then use it to addFile to the ZIP and then we delete the temporary HTML report)
I recommend you also dump $html_report_pathname near line 2046 in file.php and see if the path for that file is also malformed. If so, you might want to normalize it too before using it.
#6
@
6 years ago
@allendav you were correct. Although the file creation was working since the \
where not getting removed still there was a mix of \
+ /
so I added another normalize as you said in 43908.2.diff .
Works properly again without any issues.
43908.diff uses
wp_normalize_path
to fix\
into/
that are causing the issues under windows.Please do test, but my tests where looking good and the issues stopped.