Skip to content

Commit

Permalink
Merge pull request #23 from stellarwp/fix/windows-path-correctness
Browse files Browse the repository at this point in the history
replace the DIRECTORY_SEPARATE with slash for other OS
  • Loading branch information
borkweb authored Oct 21, 2024
2 parents dd6e75c + eb1e6e2 commit 2ba83d5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Assets/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ public static function set_path( string $path ) {

if ( DIRECTORY_SEPARATOR !== '/' ) {
$plugin_dir = str_replace( DIRECTORY_SEPARATOR, '/', $plugin_dir );
// Because the $path passed can be a constant like plugin_dir_path( __FILE__ ), we should check and replace the slash in the $path too.
$path = str_replace( DIRECTORY_SEPARATOR, '/', $path );
}

$plugins_content_dir_position = strpos( $path, $plugin_dir );
Expand Down

0 comments on commit 2ba83d5

Please sign in to comment.