Skip to content

Commit

Permalink
Use DIRECTORY_SEPARATOR to fix detection on Windows (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielbachhuber authored Jan 24, 2023
1 parent e794913 commit 27de098
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions src/Find_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,48 +12,48 @@ class Find_Command {
*/
private $ignored_paths = [
// System directories
'/__MACOSX/',
'__MACOSX/',
// Webserver directories
'/cache/',
'/caches/',
'/logs/',
'/debuglogs/',
'/Maildir/',
'/tmp/',
'cache/',
'caches/',
'logs/',
'debuglogs/',
'Maildir/',
'tmp/',
// Generic application directories
'/configs/',
'/config/',
'/data/',
'/uploads/',
'/themes/',
'/plugins/',
'/modules/',
'/assets/',
'/thumbs/',
'/thumb/',
'/albums/',
'/attachments/',
'/js/',
'/pdf/',
'/releases/',
'/filestore/',
'configs/',
'config/',
'data/',
'uploads/',
'themes/',
'plugins/',
'modules/',
'assets/',
'thumbs/',
'thumb/',
'albums/',
'attachments/',
'js/',
'pdf/',
'releases/',
'filestore/',
// Backup directories
'/backup/',
'/backups/',
'/mysql_backups/',
'/updater_backup/',
'backup/',
'backups/',
'mysql_backups/',
'updater_backup/',
// Other applications
'/owncloud/',
'owncloud/',
// Dependency management
'/node_modules/',
'/bower_components/',
'/vendor/',
'/svn/',
'node_modules/',
'bower_components/',
'vendor/',
'svn/',
// Directory for a common script kiddie hack
'/coockies/',
'coockies/',
// Already in a WordPress install
'/wp-admin/',
'/wp-content/',
'wp-admin/',
'wp-content/',
];

/**
Expand Down Expand Up @@ -252,7 +252,7 @@ private function recurse_directory( $path ) {

// This looks like a wp-includes directory, so check if it has a
// version.php file.
if ( '/wp-includes/' === substr( $path, -13 )
if ( DIRECTORY_SEPARATOR . 'wp-includes/' === substr( $path, -13 )
&& file_exists( $path . 'version.php' ) ) {
$version_path = $path . 'version.php';
$wp_path = substr( $path, 0, -13 );
Expand Down

0 comments on commit 27de098

Please sign in to comment.