Skip to content

Commit

Permalink
Merge pull request #449 from ernilambar/fix/normalize
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Apr 4, 2024
2 parents 0885e5c + be09b4c commit 3d6af26
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions includes/Checker/Checks/Abstract_File_Check.php
Expand Up @@ -193,7 +193,7 @@ private static function file_get_contents( $file ) {
* @return array List of absolute file paths.
*/
private static function get_files( Check_Context $plugin ) {
$location = $plugin->location();
$location = wp_normalize_path( $plugin->location() );

if ( isset( self::$file_list_cache[ $location ] ) ) {
return self::$file_list_cache[ $location ];
Expand Down Expand Up @@ -228,7 +228,7 @@ private static function get_files( Check_Context $plugin ) {
}

if ( $include_file ) {
self::$file_list_cache[ $location ][] = $file_path;
self::$file_list_cache[ $location ][] = wp_normalize_path( $file_path );
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion includes/Checker/Default_Check_Collection.php
Expand Up @@ -136,7 +136,7 @@ public function exclude( array $check_slugs ): Check_Collection {
}

return $this->filter(
static function ( Check $check, $slug ) use( $check_slugs ) {
static function ( Check $check, $slug ) use ( $check_slugs ) {
return ! in_array( $slug, $check_slugs, true );
}
);
Expand Down
2 changes: 1 addition & 1 deletion includes/Plugin_Context.php
Expand Up @@ -42,7 +42,7 @@ class Plugin_Context {
* @param string $main_file The absolute path to the plugin main file.
*/
public function __construct( $main_file ) {
$this->main_file = $main_file;
$this->main_file = wp_normalize_path( $main_file );
}

/**
Expand Down
4 changes: 4 additions & 0 deletions readme.txt
Expand Up @@ -69,6 +69,10 @@ In any case, passing the checks in this tool likely helps to achieve a smooth pl

== Changelog ==

= 1.0.2 =

* Fix - Correct detection of readme files in Windows by normalizing file paths.

= 1.0.1 =

* Fix - Add missing `test-content` folder needed for runtime checks.
Expand Down

0 comments on commit 3d6af26

Please sign in to comment.