[wp-trac] [WordPress Trac] #44236: Maintain consistency between privacy export report and archive filenames
WordPress Trac
noreply at wordpress.org
Tue Sep 25 04:59:12 UTC 2018
#44236: Maintain consistency between privacy export report and archive filenames
-------------------------------------------------+-------------------------
Reporter: iandunn | Owner: GripsArt
Type: defect (bug) | Status: assigned
Priority: low | Milestone: 4.9.9
Component: Privacy | Version: 4.9.6
Severity: minor | Resolution:
Keywords: good-first-bug needs-testing has- | Focuses:
patch needs-unit-tests |
-------------------------------------------------+-------------------------
Comment (by garrett-eclipse):
To avoid potential collisions aside from use of `$obscura` would the use
of `wp_unique_filename` make sense as it does a `file_exists` check.
It also supports custom callback function which can be used to latch
customizations for this implementation.
Codex - https://codex.wordpress.org/Function_Reference/wp_unique_filename
Function -
https://github.com/WordPress/WordPress/blob/06b2e1776c017717eb083cc4568882507bb6f013
/wp-includes/functions.php#L2214-L2295
I'm not sure if it can be used directly but at the least provides existing
examples and a `file_exists` loop concept which would ensure no
collisions.
Also as this is adding some docblock for the filter whatever the
implementation would probably deserve a separate function so the code
within `wp_privacy_generate_personal_data_export_file` to get
`$file_basename` can reduce to a single line `$file_basename =
wp_unique_privacy_filename(.....)`.
All the other progress and feedback has been great thanks @GripsArt ,
@birgire & @desrosj
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44236#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list