From 029b4f7a24fd3fd71b28064ecad99887bee1f30b Mon Sep 17 00:00:00 2001 From: greatquux Date: Tue, 7 May 2019 14:49:28 -0400 Subject: [PATCH 1/3] Check for DIRECTORY_SEPARATOR Based on fix from @nuessgens at https://github.com/wpengine/phpcompat/issues/201 --- src/wpephpcompat.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wpephpcompat.php b/src/wpephpcompat.php index 2f01622..4d402bc 100644 --- a/src/wpephpcompat.php +++ b/src/wpephpcompat.php @@ -464,6 +464,10 @@ public function clean_after_scan() { * @return null */ private function add_directory( $name, $path ) { + if (DIRECTORY_SEPARATOR == '\\') { + $path = str_replace("\\","/", $path); + } + $dir = array( 'post_title' => $name, 'post_content' => $path, From 46ad74913eff636af6f2864660aaa31e7a6bea47 Mon Sep 17 00:00:00 2001 From: greatquux Date: Tue, 7 May 2019 15:03:47 -0400 Subject: [PATCH 2/3] fix lint errors --- src/wpephpcompat.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wpephpcompat.php b/src/wpephpcompat.php index 4d402bc..bffa5f6 100644 --- a/src/wpephpcompat.php +++ b/src/wpephpcompat.php @@ -464,9 +464,9 @@ public function clean_after_scan() { * @return null */ private function add_directory( $name, $path ) { - if (DIRECTORY_SEPARATOR == '\\') { - $path = str_replace("\\","/", $path); - } + if ( DIRECTORY_SEPARATOR == '\\' ) { + $path = str_replace( '\\', '/', $path ); + } $dir = array( 'post_title' => $name, From dceb22c8fb3a585866b513bacbe6696efbb32d51 Mon Sep 17 00:00:00 2001 From: greatquux Date: Tue, 7 May 2019 15:17:18 -0400 Subject: [PATCH 3/3] fix one more accidental lint error --- src/wpephpcompat.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wpephpcompat.php b/src/wpephpcompat.php index bffa5f6..fa50186 100644 --- a/src/wpephpcompat.php +++ b/src/wpephpcompat.php @@ -464,7 +464,7 @@ public function clean_after_scan() { * @return null */ private function add_directory( $name, $path ) { - if ( DIRECTORY_SEPARATOR == '\\' ) { + if ( DIRECTORY_SEPARATOR == '\\' ) { $path = str_replace( '\\', '/', $path ); }