mirror of
https://github.com/joomla-extensions/jedchecker.git
synced 2025-01-06 15:53:55 +00:00
Fix detection of root directory as library
This commit is contained in:
parent
83368f14ba
commit
5e452cfbd0
@ -178,11 +178,12 @@ class JedcheckerRulesJexec extends JEDcheckerRule
|
|||||||
* Collect php files to check (excluding external library directories)
|
* Collect php files to check (excluding external library directories)
|
||||||
*
|
*
|
||||||
* @param string $path The path of the folder to read.
|
* @param string $path The path of the folder to read.
|
||||||
|
* @param int $level The current hierarchy level.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
protected function files($path)
|
protected function files($path, $level = 0)
|
||||||
{
|
{
|
||||||
$arr = array();
|
$arr = array();
|
||||||
|
|
||||||
@ -198,17 +199,20 @@ class JedcheckerRulesJexec extends JEDcheckerRule
|
|||||||
|
|
||||||
if (is_dir($fullpath))
|
if (is_dir($fullpath))
|
||||||
{
|
{
|
||||||
// Detect and skip external library directories
|
if ($level > 0)
|
||||||
foreach ($this->libFiles as $libFile)
|
|
||||||
{
|
{
|
||||||
if (is_file($fullpath . '/' . $libFile))
|
// Detect and skip external library directories
|
||||||
|
foreach ($this->libFiles as $libFile)
|
||||||
{
|
{
|
||||||
// Skip processing of this directory
|
if (is_file($fullpath . '/' . $libFile))
|
||||||
continue 2;
|
{
|
||||||
|
// Skip processing of this directory
|
||||||
|
continue 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$arr = array_merge($arr, $this->files($fullpath));
|
$arr = array_merge($arr, $this->files($fullpath, $level + 1));
|
||||||
}
|
}
|
||||||
elseif (preg_match('/\.php$/', $file))
|
elseif (preg_match('/\.php$/', $file))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user