From 81413989a6983edd0f22e9d8ab3a9e81c182153c Mon Sep 17 00:00:00 2001 From: Nilambar Sharma Date: Fri, 11 Oct 2024 19:58:37 +0545 Subject: [PATCH] Fix bad file issue --- includes/Checker/Checks/Plugin_Repo/File_Type_Check.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php index f1e54734..fa4000dc 100644 --- a/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php +++ b/includes/Checker/Checks/Plugin_Repo/File_Type_Check.php @@ -260,6 +260,15 @@ protected function look_for_application_files( Check_Result $result, array $file protected function look_for_badly_named_files( Check_Result $result, array $files ) { $conflict_chars = '!@#$%^&*()+=[]{};:"\'<>,?/\\|`~'; + $plugin_path = $result->plugin()->path(); + + $files = array_map( + function ( $file ) use ( $plugin_path ) { + return substr( $file, strlen( $plugin_path ) ); + }, + $files + ); + foreach ( $files as $file ) { $badly_name = false; if ( preg_match( '/\s/', $file ) ) {