1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-10 08:44:46 +02:00
This commit is contained in:
Ryan Cramer
2023-07-27 09:24:40 -04:00
parent b656b254e8
commit d6ca1232e2
2 changed files with 24 additions and 8 deletions

View File

@@ -649,11 +649,15 @@ class ModulesInfo extends ModulesClass {
if(!$info['installed'] && !$info['created'] && $installableFile) {
// uninstalled modules get their created date from the file or dir that they are in (whichever is newer)
$pathname = $installableFile;
$filemtime = (int) filemtime($pathname);
$dirname = dirname($pathname);
$coreModulesPath = $this->modules->coreModulesPath;
$dirmtime = substr($dirname, -7) == 'modules' || strpos($dirname, $coreModulesPath) !== false ? 0 : (int) filemtime($dirname);
$info['created'] = $dirmtime > $filemtime ? $dirmtime : $filemtime;
$filemtime = @filemtime($pathname);
if($filemtime === false) {
$info['created'] = 0;
} else {
$dirname = dirname($pathname);
$coreModulesPath = $this->modules->coreModulesPath;
$dirmtime = substr($dirname, -7) == 'modules' || strpos($dirname, $coreModulesPath) !== false ? 0 : (int) filemtime($dirname);
$info['created'] = $dirmtime > $filemtime ? $dirmtime : $filemtime;
}
}
// namespace