Update LogViewer.php
This commit is contained in:
parent
eb0d72ffc8
commit
313a1c5c8e
|
@ -81,19 +81,23 @@ class LogViewer
|
||||||
|
|
||||||
protected function getRealPath($path)
|
protected function getRealPath($path)
|
||||||
{
|
{
|
||||||
$paths = explode('/', $path);
|
try {
|
||||||
|
$paths = explode('/', $path);
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
foreach ($paths as $v) {
|
foreach ($paths as $v) {
|
||||||
$result .= $v.'/';
|
$result .= $v.'/';
|
||||||
|
|
||||||
$current = rtrim($result, '/');
|
$current = rtrim($result, '/');
|
||||||
if (is_link($current)) {
|
if (is_link($current)) {
|
||||||
$result = readlink($current).'/';
|
$result = readlink($current).'/';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
return rtrim($result, '/');
|
return rtrim($result, '/');
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return $path;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function formatPath($path)
|
protected function formatPath($path)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user