Skip to content

Commit

Permalink
Fix bad file issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ernilambar committed Oct 11, 2024
1 parent 54ddd84 commit 8141398
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions includes/Checker/Checks/Plugin_Repo/File_Type_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) ) {
Expand Down

0 comments on commit 8141398

Please sign in to comment.