wip
This commit is contained in:
parent
5396f8d6de
commit
d65ff46fef
|
@ -74,11 +74,16 @@ class LogViewer
|
||||||
public function __construct($basePath, $dir, $file = null)
|
public function __construct($basePath, $dir, $file = null)
|
||||||
{
|
{
|
||||||
$this->basePath = rtrim($basePath, '/');
|
$this->basePath = rtrim($basePath, '/');
|
||||||
$this->currentDirectory = rtrim($dir, '/');
|
$this->currentDirectory = $this->formatPath(rtrim($dir, '/'));
|
||||||
$this->file = $file;
|
$this->file = $this->formatPath($file);
|
||||||
$this->files = new Filesystem();
|
$this->files = new Filesystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function formatPath($path)
|
||||||
|
{
|
||||||
|
return str_replace(['../'], '', $path);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get file path by giving log file name.
|
* Get file path by giving log file name.
|
||||||
*
|
*
|
||||||
|
@ -103,7 +108,7 @@ class LogViewer
|
||||||
|
|
||||||
public function setFilename($value)
|
public function setFilename($value)
|
||||||
{
|
{
|
||||||
$this->filename = $value;
|
$this->filename = $this->formatPath($value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user