Skip to content

Commit

Permalink
fix: wpcs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sidsector9 committed Oct 18, 2021
1 parent 0777676 commit 8cbef59
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Export_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ private static function get_filename_template( $filename_format ) {
/**
* Get the potential filename.
*/
$potential_file_name = str_replace( [ '{site}', '{date}', '{n}' ], [ $sitename, date( 'Y-m-d' ), '%03d' ], $filename_format );
$potential_file_name = str_replace( [ '{site}', '{date}', '{n}' ], [ $sitename, gmdate( 'Y-m-d' ), '%03d' ], $filename_format );

/**
* Get the length of the potential file name.
Expand All @@ -226,7 +226,7 @@ private static function get_filename_template( $filename_format ) {
* If the potential filename size exceeds 99 bytes, then remove the extra bytes.
*/
if ( $potential_file_name_size > 99 ) {
$extra_bytes = $potential_file_name_size - 99;
$extra_bytes = $potential_file_name_size - 99;
$sitename_size = strlen( $sitename );

/**
Expand All @@ -235,7 +235,7 @@ private static function get_filename_template( $filename_format ) {
$sitename = substr( $sitename, 0, ( $sitename_size - $extra_bytes ) + 1 );
}

return str_replace( [ '{site}', '{date}', '{n}' ], [ $sitename, date( 'Y-m-d' ), '%03d' ], $filename_format ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
return str_replace( [ '{site}', '{date}', '{n}' ], [ $sitename, gmdate( 'Y-m-d' ), '%03d' ], $filename_format ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions.date_date
}

public static function load_export_api() {
Expand Down

0 comments on commit 8cbef59

Please sign in to comment.