Merge pull request #22624 from tivnet/patch-6
WC_Log_Handler_File::remove - fix for MS Windows
This commit is contained in:
commit
d644f84e42
|
@ -253,7 +253,7 @@ class WC_Log_Handler_File extends WC_Log_Handler {
|
|||
|
||||
if ( isset( $logs[ $handle ] ) && $logs[ $handle ] ) {
|
||||
$file = realpath( trailingslashit( WC_LOG_DIR ) . $logs[ $handle ] );
|
||||
if ( 0 === stripos( $file, trailingslashit( WC_LOG_DIR ) ) && is_file( $file ) && is_writable( $file ) ) { // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable
|
||||
if ( 0 === stripos( $file, realpath( trailingslashit( WC_LOG_DIR ) ) ) && is_file( $file ) && is_writable( $file ) ) { // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable
|
||||
$this->close( $file ); // Close first to be certain no processes keep it alive after it is unlinked.
|
||||
$removed = unlink( $file ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_unlink
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue