mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-27 09:09:04 +01:00
do not allow path traversal and htmlencode displayed path
This commit is contained in:
parent
f5af05ffd2
commit
5b573abef7
@ -74,6 +74,9 @@ class Tail
|
||||
|
||||
if ($filename)
|
||||
{
|
||||
// do NOT allow path-traversal
|
||||
$filename = str_replace('../', '', $filename);
|
||||
|
||||
$this->filename = $filename;
|
||||
|
||||
if (!$this->filenames || !in_array($filename,$this->filenames)) $this->filenames[] = $filename;
|
||||
@ -176,7 +179,7 @@ class Tail
|
||||
'filename' => $this->filename,
|
||||
)).'
|
||||
</div>
|
||||
<pre class="tail" id="log" data-filename="'.$this->filename.'" style="clear: both; width: 99.5%; border: 2px groove silver; margin-bottom: 0; overflow: auto;"></pre>';
|
||||
<pre class="tail" id="log" data-filename="'.htmlspecialchars($this->filename).'" style="clear: both; width: 99.5%; border: 2px groove silver; margin-bottom: 0; overflow: auto;"></pre>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user