mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
File Inspector fixes/upgrades.
This commit is contained in:
@@ -145,6 +145,7 @@ class file_inspector {
|
|||||||
|
|
||||||
private $excludeFiles = array( '.', '..','/','.svn', 'CVS' ,'Thumbs.db', '.git');
|
private $excludeFiles = array( '.', '..','/','.svn', 'CVS' ,'Thumbs.db', '.git');
|
||||||
|
|
||||||
|
private $knownSecurityIssues = array('htmlarea', 'e107_docs/docs.php');
|
||||||
// private $icon = array();
|
// private $icon = array();
|
||||||
private $iconTag = array();
|
private $iconTag = array();
|
||||||
|
|
||||||
@@ -764,7 +765,8 @@ class file_inspector {
|
|||||||
|
|
||||||
if (!isset($this -> files[$dir_id][$aid]['file']) && !$known[$dir_id][$aid])
|
if (!isset($this -> files[$dir_id][$aid]['file']) && !$known[$dir_id][$aid])
|
||||||
{
|
{
|
||||||
if (strpos($dir.'/'.$readdir, 'htmlarea') === false) {
|
if ($this->checkKnownSecurity($dir.'/'.$readdir) === false)
|
||||||
|
{
|
||||||
if (isset($deprecated[$readdir]))
|
if (isset($deprecated[$readdir]))
|
||||||
{
|
{
|
||||||
if ($_POST['oldcore'])
|
if ($_POST['oldcore'])
|
||||||
@@ -866,6 +868,22 @@ class file_inspector {
|
|||||||
return $text;
|
return $text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function checkKnownSecurity($path)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach($this->knownSecurityIssues as $v)
|
||||||
|
{
|
||||||
|
if(strpos($path, $v) !== false)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function scan_results()
|
function scan_results()
|
||||||
{
|
{
|
||||||
global $ns, $rs, $core_image, $deprecated_image;
|
global $ns, $rs, $core_image, $deprecated_image;
|
||||||
@@ -942,9 +960,9 @@ class file_inspector {
|
|||||||
$text .= "<tr><td style='padding-left: 4px' colspan='2'>
|
$text .= "<tr><td style='padding-left: 4px' colspan='2'>
|
||||||
".$this->iconTag['warning']." <b>".FR_LAN_26."</b></td></tr>";
|
".$this->iconTag['warning']." <b>".FR_LAN_26."</b></td></tr>";
|
||||||
|
|
||||||
$text .= "<tr><td class='f'>".$this->iconTag['file_warning']." ".FR_LAN_28.": ".($this -> count['warning']['num'] ? $this -> count['warning']['num'] : FR_LAN_21)." </td><td class='s'>".$this -> parsesize($this -> count['warning']['size'], 2)."</td></tr>";
|
$text .= "<tr><td class='f'>".$this->iconTag['file_warning']." ".FR_LAN_28.": ".($this -> count['warning']['num'] ? $this -> count['warning']['num'] : FR_LAN_21)." </td><td class='s'>".$this -> parsesize($this -> count['warning']['size'], 2)."</td></tr>";
|
||||||
|
|
||||||
$text .= "<tr><td class='w' colspan='2'>".$this->iconTag['info']." ".FR_LAN_27."</td></tr>";
|
$text .= "<tr><td class='w' colspan='2'><div class='alert alert-warning'>".FR_LAN_27."</div></td></tr>";
|
||||||
|
|
||||||
}
|
}
|
||||||
if ($_POST['integrity'] && $_POST['core'] != 'none')
|
if ($_POST['integrity'] && $_POST['core'] != 'none')
|
||||||
|
Reference in New Issue
Block a user