mirror of
https://github.com/e107inc/e107.git
synced 2025-04-21 21:21:54 +02:00
File Inspector fixes/upgrades.
This commit is contained in:
parent
46a63ca70e
commit
c748f0fdb3
@ -145,6 +145,7 @@ class file_inspector {
|
||||
|
||||
private $excludeFiles = array( '.', '..','/','.svn', 'CVS' ,'Thumbs.db', '.git');
|
||||
|
||||
private $knownSecurityIssues = array('htmlarea', 'e107_docs/docs.php');
|
||||
// private $icon = array();
|
||||
private $iconTag = array();
|
||||
|
||||
@ -764,7 +765,8 @@ class file_inspector {
|
||||
|
||||
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 ($_POST['oldcore'])
|
||||
@ -866,6 +868,22 @@ class file_inspector {
|
||||
return $text;
|
||||
}
|
||||
|
||||
private function checkKnownSecurity($path)
|
||||
{
|
||||
|
||||
foreach($this->knownSecurityIssues as $v)
|
||||
{
|
||||
if(strpos($path, $v) !== false)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function scan_results()
|
||||
{
|
||||
global $ns, $rs, $core_image, $deprecated_image;
|
||||
@ -942,9 +960,9 @@ class file_inspector {
|
||||
$text .= "<tr><td style='padding-left: 4px' colspan='2'>
|
||||
".$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')
|
||||
|
@ -860,7 +860,7 @@ class e_db_mysql
|
||||
|
||||
|
||||
/**
|
||||
* Return the total number of results on the last query regardless of the LIMIT value.
|
||||
* Return the total number of results on the last query regardless of the LIMIT value.
|
||||
* @return bool
|
||||
*/
|
||||
public function totalResults()
|
||||
|
Loading…
x
Reference in New Issue
Block a user