Closed Chrico closed 6 years ago
Describe the bug I have a normal WP Starter 3 setup and a mu-plugin which is loaded via composer.json ( https://github.com/inpsyde/WP-Stash ).
The WP Starter 3 Script generates following wpstarter-mu-loader.php:
wpstarter-mu-loader.php
<?php declare(strict_types=1); /** * Plugin Name: WP Starter MU plugins loader. * Description: MU plugins loaded: wp-stash/wp-stash.php. */ foreach (explode(',', 'wp-stash/wp-stash.php') as $muPlugin) { $filePath = wp_normalize_path(__DIR__ . '/'. trim($muPlugin)); // Skip unexistent, unreadable and non-php files if ($filePath && is_file($filePath) && is_readable($filePath) && strtolower(pathinfo($filePath, PATHINFO_EXTENSION)) === 'php' && validate_file($filePath) === 0 ) { require_once $filePath; } }
Sadly the validate_file_check() fails, because it returns 2. I guess the if-check should be !== 0 to ensure that the file is "okay".
validate_file_check()
2
if
!== 0
To Reproduce
composer install
Expected behavior The check shouldn't fail for valid files ;-)
System (please complete the following information):
validate_file return 0 when everything is fine.
validate_file
0
The problem is that it fails for absolute paths. I'll fix.
@Chrico can you please test last commit?
works now. Thanks 👍
Describe the bug I have a normal WP Starter 3 setup and a mu-plugin which is loaded via composer.json ( https://github.com/inpsyde/WP-Stash ).
The WP Starter 3 Script generates following
wpstarter-mu-loader.php
:Sadly the
validate_file_check()
fails, because it returns2
. I guess theif
-check should be!== 0
to ensure that the file is "okay".To Reproduce
composer install
Expected behavior The check shouldn't fail for valid files ;-)
System (please complete the following information):