1
0
mirror of https://github.com/e107inc/e107.git synced 2025-07-31 20:00:37 +02:00

PHP 8: Fixed fatal error in fileinspector.php

```
PHP Fatal error:  Uncaught TypeError: Unsupported operand types: array & int in ~/public_html/e107_admin/fileinspector.php:1266
Stack trace:
#0 ~/public_html/e107_admin/fileinspector.php(717): file_inspector->getOldVersionOfPath()
#1 ~/public_html/e107_admin/fileinspector.php(677): file_inspector->generateDirectoryHtml()
#2 ~/public_html/e107_admin/fileinspector.php(961): file_inspector->generateScanResultsHtml()
#3 ~/public_html/e107_admin/fileinspector.php(156): file_inspector->scan_results()
#4 ~/public_html/e107_handlers/admin_ui.php(1076): fileinspector_admin->init()
#5 ~/public_html/e107_admin/fileinspector.php(249): e_admin_dispatcher->__construct()
#6 {main}
  thrown in ~/public_html/e107_admin/fileinspector.php on line 1266
```
This commit is contained in:
Nick Liu
2020-12-31 13:22:42 +01:00
parent 515d81ebb7
commit ad44a3d5f0

View File

@@ -714,7 +714,6 @@ class file_inspector {
if ($level === 0) $relativePath = '';
$rowId = str_replace(" ", "%20", $relativePath);
list($icon, $title) = $this->getGlyphForValidationCode($validationCode);
$oldVersion = $this->getOldVersionOfPath($relativePath, $validationCode);
$html .= "<div class=\"d\" title=\"$title\" style=\"margin-left: " . ($level * 8) . "px\">";
$html .= "<span class='tree-node' onclick=\"ec('$rowId')\">";
$html .= $this->getTreeActionImageForFile($tree, $fileName, $rowId, $hide);
@@ -729,6 +728,7 @@ class file_inspector {
}
else
{
$oldVersion = $this->getOldVersionOfPath($relativePath, $validationCode);
$html .= '<span style="float:right">';
$html .= isset($this->fileSizes[$relativePath]) ? $this->parsesize($this->fileSizes[$relativePath]) : '';
$html .= $oldVersion ? " (v$oldVersion)" : "";