Skip to content

Commit

Permalink
Merge pull request #74 from Codeinwp/dev
Browse files Browse the repository at this point in the history
fix: adds is_file for file existence check
  • Loading branch information
selul authored Aug 8, 2019
2 parents 4c85a6c + be119c1 commit d1205c4
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion load.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
$themeisle_sdk_relative_licenser_path = '/src/Modules/Licenser.php';

global $themeisle_sdk_abs_licenser_path;
if ( ! file_exists( $themeisle_sdk_path . $themeisle_sdk_relative_licenser_path ) && file_exists( $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path ) ) {
if ( ! is_file( $themeisle_sdk_path . $themeisle_sdk_relative_licenser_path ) && is_file( $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path ) ) {
$themeisle_sdk_abs_licenser_path = $themeisle_sdk_max_path . $themeisle_sdk_relative_licenser_path;
add_filter( 'themeisle_sdk_required_files', 'themeisle_sdk_load_licenser_if_present' );
}
Expand Down
2 changes: 1 addition & 1 deletion src/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static function init() {
*/
public static function add_product( $base_file ) {

if ( ! is_readable( $base_file ) ) {
if ( ! is_file( $base_file ) ) {
return self::$instance;
}
$product = new Product( $base_file );
Expand Down
2 changes: 1 addition & 1 deletion src/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Product {
*/
public function __construct( $basefile ) {
if ( ! empty( $basefile ) ) {
if ( is_readable( $basefile ) ) {
if ( is_file( $basefile ) ) {
$this->basefile = $basefile;
$this->setup_from_path();
$this->setup_from_fileheaders();
Expand Down
2 changes: 1 addition & 1 deletion start.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
$files_to_load = array_merge( $files_to_load, apply_filters( 'themeisle_sdk_required_files', [] ) );

foreach ( $files_to_load as $file ) {
if ( is_readable( $file ) ) {
if ( is_file( $file ) ) {
require_once $file;
}
}
Expand Down

0 comments on commit d1205c4

Please sign in to comment.