[wp-trac] [WordPress Trac] #44236: Maintain consistency between privacy export report and archive filenames

WordPress Trac noreply at wordpress.org
Mon Sep 3 09:42:50 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 birgire):

 This filter reminds of the {{{export_wp_filename}}}:

 {{{
 $wp_filename = $sitename . 'WordPress.' . $date . '.xml';
 /**
  * Filters the export filename.
  *
  * @since 4.4.0
  *
  * @param string $wp_filename The name of the file for download.
  * @param string $sitename    The site name.
  * @param string $date        Today's date, formatted.
  */
  $filename = apply_filters( 'export_wp_filename', $wp_filename, $sitename,
 $date );

 }}}

 apart from that it's the name for the download file, saved on the users
 disk and not the server. So I think more restriction would be needed for
 the latter case.


 Reviewing [attachment:"44263.4.patch"]:

 Some cases to consider for the suggested
 {{{wp_personal_export_file_basename}}} filter:

 - The filter can add characters not supported by the file system.
 - The filter can add non-unique file names and override previous files.

 If the filter is going to be added, then I would suggest adding more input
 arguments, like:

 {{{
 $file_basename = apply_filters(
     'wp_personal_export_file_basename',
     $file_basename,
     $stripped_email,
     $obscura,
     $request_id
 );
 }}}

 and also move this line:

 {{{
 $file_basename            = 'wp-personal-data-file-' . $stripped_email .
 '-' . $obscura;
 }}}

 above the inline filter's documentation.

 There's also a missing full-stop end for the filter's inline description.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/44236#comment:14>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list