Файл: Luxe-Shop v6.0/application/views/sheild/classes/class.file_protector.php
Строк: 33
<?php
class file_protector
{
private $files=array();
private $type;
private $status;
private $infected=array();
public function __construct()
{
$this->status=0;
$this->files=array('.php', '.php5', '.php4', '.inc', '.pl', '.sql');
foreach ($_FILES as $file)
{
$filename=$file['name'];
foreach ($this->files as $file_extention)
{
if (ereg('\'.$file_extention.'$', $filename))
{
$this->type=$file_extention;
array_push($this->infected, $file['tmp_name']);
$this->status=1;
}
}
}
}
public function alert()
{
foreach ($this->infected as $wrong_file)
{
unlink($wrong_file);
}
header("Location: sheild/html/wrong_file.html");
exit;
}
public function gettype()
{
return 'wrong excutable file';
}
public function getstatus()
{
return $this->status;
}
}
?>