1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-08 07:36:32 +02:00

File Inspector now shows the old e107 version of core files

Bugfixes related to this change:

* e_file_inspector: During validation, the checksum is now calculated,
  even if the file is old.
* e_file_inspector_json: Strip the "v" from the beginning of version
  numbers in the database to make them proper PHP-standardized versions.
This commit is contained in:
Nick Liu
2020-03-27 16:00:39 -05:00
parent 09d3d2b166
commit b4f55049f8
3 changed files with 32 additions and 1 deletions

View File

@@ -71,7 +71,7 @@ abstract class e_file_inspector implements e_file_inspector_interface
$absolutePath = realpath(e_BASE . $path);
$dbChecksums = $this->getChecksums($path);
$dbChecksum = $this->getChecksum($path, $version);
$actualChecksum = $dbChecksum ? $this->checksumPath($absolutePath) : null;
$actualChecksum = !empty($dbChecksums) ? $this->checksumPath($absolutePath) : null;
if (!empty($dbChecksums)) $bits |= self::VALIDATED_PATH_KNOWN;
if ($dbChecksum !== false) $bits |= self::VALIDATED_PATH_VERSION;

View File

@@ -63,6 +63,7 @@ class e_file_inspector_json extends e_file_inspector
/**
* Flatten a multi-dimensional associative array with slashes.
* Excludes the second-to-last level of depth from flattening.
* Also removes the leading "v" from all version keys.
*
* Based on Illuminate\Support\Arr::dot()
*
@@ -84,6 +85,11 @@ class e_file_inspector_json extends e_file_inspector
}
else
{
foreach ($value as $versionWithV => $checksum)
{
$value[ltrim($versionWithV, 'v')] = $checksum;
unset($value[$versionWithV]);
}
$results[$prepend . $key] = $value;
}
}