From d7ec12f6dcbeb6b08c659e17e77bb52e29f2fa29 Mon Sep 17 00:00:00 2001 From: Ben Dwyer Date: Fri, 13 May 2022 15:39:09 +0100 Subject: [PATCH] Theme Export: Use basename when determining the theme slug --- .../class-gutenberg-rest-edit-site-export-controller.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/compat/wordpress-6.0/class-gutenberg-rest-edit-site-export-controller.php b/lib/compat/wordpress-6.0/class-gutenberg-rest-edit-site-export-controller.php index 13862bc97a197..e4cffb2bff268 100644 --- a/lib/compat/wordpress-6.0/class-gutenberg-rest-edit-site-export-controller.php +++ b/lib/compat/wordpress-6.0/class-gutenberg-rest-edit-site-export-controller.php @@ -76,9 +76,7 @@ public function export() { return $filename; } - $stylesheet = get_stylesheet(); - $stylesheet_directories = explode( '/', $stylesheet ); - $theme_name = end( $stylesheet_directories ); + $theme_name = basename( get_stylesheet() ); header( 'Content-Type: application/zip' ); header( 'Content-Disposition: attachment; filename=' . $theme_name . '.zip' );