Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Glob can return false on error, we should check before running a fore…
Browse files Browse the repository at this point in the history
…ach.
  • Loading branch information
cdujeu committed Dec 2, 2015
1 parent 3975752 commit 85b7754
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions core/src/conf/bootstrap_context.php
Expand Up @@ -144,8 +144,10 @@ function AjaXplorer_autoload($className)
if(!is_file(AJXP_PLUGINS_BOOTSTRAP_CACHE)){
$content = "<?php \n";
$boots = glob(AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/*/bootstrap.php");
foreach($boots as $b){
$content .= 'require_once("'.$b.'");'."\n";
if($boots !== false){
foreach($boots as $b){
$content .= 'require_once("'.$b.'");'."\n";
}
}
$resWriteBootstrapCache = @file_put_contents(AJXP_PLUGINS_BOOTSTRAP_CACHE, $content);
}
Expand Down
6 changes: 4 additions & 2 deletions core/src/conf/bootstrap_repositories.php
Expand Up @@ -180,8 +180,10 @@
if(!is_file(AJXP_PLUGINS_REPOSITORIES_CACHE)){
$content = "<?php \n";
$boots = glob(AJXP_INSTALL_PATH."/".AJXP_PLUGINS_FOLDER."/*/repositories.php");
foreach($boots as $b){
$content .= 'require_once("'.$b.'");'."\n";
if($boots !== false){
foreach($boots as $b){
$content .= 'require_once("'.$b.'");'."\n";
}
}
$resWriteRepoCache = @file_put_contents(AJXP_PLUGINS_REPOSITORIES_CACHE, $content);
}
Expand Down

0 comments on commit 85b7754

Please sign in to comment.