From 58ad2981b382249eaa7bafdfe31cbe5262012282 Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 18 Feb 2022 10:17:31 +0100 Subject: [PATCH 1/2] Add directory separator constant for windows support --- src/Find_Command.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Find_Command.php b/src/Find_Command.php index dea3e21..8525d85 100644 --- a/src/Find_Command.php +++ b/src/Find_Command.php @@ -243,7 +243,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 ); From d3e0747be23dad3c9384c280e7c5adfc6f0d7c0a Mon Sep 17 00:00:00 2001 From: Vincent Date: Fri, 18 Feb 2022 10:20:07 +0100 Subject: [PATCH 2/2] Remove first '/' in ignored paths --- src/Find_Command.php | 70 ++++++++++++++++++++++---------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/src/Find_Command.php b/src/Find_Command.php index 8525d85..0f3ed2a 100644 --- a/src/Find_Command.php +++ b/src/Find_Command.php @@ -11,48 +11,48 @@ class Find_Command { */ private $ignored_paths = array( // 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/', ); /**