From 3772d4d8d22ea67edce268019708ca023b6a2191 Mon Sep 17 00:00:00 2001 From: Shea Bunge Date: Thu, 2 Jun 2022 16:48:57 +1000 Subject: [PATCH] Include snippets list in code_snippets/export/filename filter --- php/class-export.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/php/class-export.php b/php/class-export.php index 7d6b65b9..dbd80d2f 100644 --- a/php/class-export.php +++ b/php/class-export.php @@ -64,11 +64,11 @@ private function do_headers( $format, $mime_type = 'text/plain' ) { } $filename = "$title.code-snippets.$format"; - $filename = apply_filters( 'code_snippets/export/filename', $filename, $title ); + $filename = apply_filters( 'code_snippets/export/filename', $filename, $title, $this->snippets_list ); /* Set HTTP headers */ header( 'Content-Disposition: attachment; filename=' . sanitize_file_name( $filename ) ); - header( "Content-Type: $mime_type; charset=" . get_bloginfo( 'charset' ) ); + header( sprintf( "Content-Type: %s; charset=%s", sanitize_mime_type( $mime_type ), get_bloginfo( 'charset' ) ) ); } /**