Skip to content

Commit 27de098

Browse files
Use DIRECTORY_SEPARATOR to fix detection on Windows (#67)
1 parent e794913 commit 27de098

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

src/Find_Command.php

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,48 @@ class Find_Command {
1212
*/
1313
private $ignored_paths = [
1414
// System directories
15-
'/__MACOSX/',
15+
'__MACOSX/',
1616
// Webserver directories
17-
'/cache/',
18-
'/caches/',
19-
'/logs/',
20-
'/debuglogs/',
21-
'/Maildir/',
22-
'/tmp/',
17+
'cache/',
18+
'caches/',
19+
'logs/',
20+
'debuglogs/',
21+
'Maildir/',
22+
'tmp/',
2323
// Generic application directories
24-
'/configs/',
25-
'/config/',
26-
'/data/',
27-
'/uploads/',
28-
'/themes/',
29-
'/plugins/',
30-
'/modules/',
31-
'/assets/',
32-
'/thumbs/',
33-
'/thumb/',
34-
'/albums/',
35-
'/attachments/',
36-
'/js/',
37-
'/pdf/',
38-
'/releases/',
39-
'/filestore/',
24+
'configs/',
25+
'config/',
26+
'data/',
27+
'uploads/',
28+
'themes/',
29+
'plugins/',
30+
'modules/',
31+
'assets/',
32+
'thumbs/',
33+
'thumb/',
34+
'albums/',
35+
'attachments/',
36+
'js/',
37+
'pdf/',
38+
'releases/',
39+
'filestore/',
4040
// Backup directories
41-
'/backup/',
42-
'/backups/',
43-
'/mysql_backups/',
44-
'/updater_backup/',
41+
'backup/',
42+
'backups/',
43+
'mysql_backups/',
44+
'updater_backup/',
4545
// Other applications
46-
'/owncloud/',
46+
'owncloud/',
4747
// Dependency management
48-
'/node_modules/',
49-
'/bower_components/',
50-
'/vendor/',
51-
'/svn/',
48+
'node_modules/',
49+
'bower_components/',
50+
'vendor/',
51+
'svn/',
5252
// Directory for a common script kiddie hack
53-
'/coockies/',
53+
'coockies/',
5454
// Already in a WordPress install
55-
'/wp-admin/',
56-
'/wp-content/',
55+
'wp-admin/',
56+
'wp-content/',
5757
];
5858

5959
/**
@@ -252,7 +252,7 @@ private function recurse_directory( $path ) {
252252

253253
// This looks like a wp-includes directory, so check if it has a
254254
// version.php file.
255-
if ( '/wp-includes/' === substr( $path, -13 )
255+
if ( DIRECTORY_SEPARATOR . 'wp-includes/' === substr( $path, -13 )
256256
&& file_exists( $path . 'version.php' ) ) {
257257
$version_path = $path . 'version.php';
258258
$wp_path = substr( $path, 0, -13 );

0 commit comments

Comments
 (0)