From 4d78b7d0946a8297ff5ba66e9f180c7c247e8905 Mon Sep 17 00:00:00 2001 From: jrfnl Date: Fri, 10 May 2019 03:29:32 +0200 Subject: [PATCH] PrefixAllGlobals: bugfix Using the `DIRECTORY_SEPARATOR` constant will allow the sniff to be platform agnostic, so the unit tests will work on both Linux, Mac and Windows. --- .../Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php b/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php index 5c427055..38a4c1a2 100644 --- a/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php +++ b/WPThemeReview/Sniffs/CoreFunctionality/PrefixAllGlobalsSniff.php @@ -82,7 +82,7 @@ private function is_from_allowed_folder( $path ) { } foreach ( $this->allowed_folders as $folder ) { - if ( strrpos( $path, '/' . $folder . '/' ) !== false ) { + if ( strrpos( $path, DIRECTORY_SEPARATOR . $folder . DIRECTORY_SEPARATOR ) !== false ) { return true; } }