diff --git a/Model/SecurityChecker/CheckArchiveInRootAndSubFolder.php b/Model/SecurityChecker/CheckArchiveInRootAndSubFolder.php index 87fb614..06ceb49 100644 --- a/Model/SecurityChecker/CheckArchiveInRootAndSubFolder.php +++ b/Model/SecurityChecker/CheckArchiveInRootAndSubFolder.php @@ -72,7 +72,7 @@ public function __construct( File $file, SecurityStatusCacheFactory $securityStatusCacheFactory, Json $json, - $position = null + $position = null ) { $this->directoryList = $directoryList; $this->file = $file; @@ -172,7 +172,7 @@ private function isExcluded(string $path): bool $result = false; foreach ($this->exclude as $excludePath) { - if (strpos($path, $this->directoryList->getRoot() . '/' . $excludePath) === 0) { + if (strpos($path, $excludePath) !== false) { $result = true; break; } diff --git a/Model/SecurityChecker/CheckMagentoAndPhpVersion.php b/Model/SecurityChecker/CheckMagentoAndPhpVersion.php index ddfeb19..7187882 100644 --- a/Model/SecurityChecker/CheckMagentoAndPhpVersion.php +++ b/Model/SecurityChecker/CheckMagentoAndPhpVersion.php @@ -59,7 +59,7 @@ public function __construct( Curl $curl, SecurityStatusCacheFactory $securityStatusCacheFactory, Json $json, - $position = null + $position = null ) { $this->productMetadata = $productMetadata; $this->curl = $curl; @@ -96,7 +96,10 @@ public function updateCache() $tags = json_decode($response, true); if (json_last_error() == JSON_ERROR_NONE) { foreach ($tags as $key => $tag) { - if (!isset($tag['name']) || (false !== strpos($tag['name'], 'beta'))) { + if (!isset($tag['name']) || + (false !== strpos($tag['name'], 'alpha')) || + (false !== strpos($tag['name'], 'beta')) + ) { continue; } diff --git a/Model/SecurityChecker/CheckSQLInRootAndSubFolder.php b/Model/SecurityChecker/CheckSQLInRootAndSubFolder.php index e94dc95..a15eb73 100644 --- a/Model/SecurityChecker/CheckSQLInRootAndSubFolder.php +++ b/Model/SecurityChecker/CheckSQLInRootAndSubFolder.php @@ -54,8 +54,7 @@ class CheckSQLInRootAndSubFolder extends AbstractChecker * @var string[] */ private $exclude = [ - 'vendor/laminas/laminas-db/', - 'vendor/magento/magento2-base/dev/', + 'vendor', 'dev/tests/' ]; @@ -71,7 +70,7 @@ public function __construct( File $file, Json $json, SecurityStatusCacheFactory $securityStatusCacheFactory, - $position = null + $position = null ) { $this->directoryList = $directoryList; $this->file = $file; @@ -106,7 +105,7 @@ public function updateCache() $filterIterator = new \RecursiveCallbackFilterIterator($directoryIterator, [$this, 'filterCallback']); $iterator = new \RecursiveIteratorIterator($filterIterator); - + $sqlPathFiles = []; foreach ($iterator as $file) { @@ -134,7 +133,7 @@ public function updateCache() return $this; } - /** + /** * @param mixed $current * @param mixed $key * @param mixed $iterator @@ -158,7 +157,7 @@ private function isExcluded(string $path): bool $result = false; foreach ($this->exclude as $excludePath) { - if (strpos($path, $this->directoryList->getRoot() . '/' . $excludePath) === 0) { + if (strpos($path, $excludePath) !== false) { $result = true; break; }