Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion libraries/src/Language/LanguageHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,18 @@ public static function parseIniFile($fileName, $debug = false)
$cacheFile = JPATH_CACHE . '/language/' . ltrim(str_replace([JPATH_ROOT, '/'], ['', '-'], $fileName), '-') . '.' . filemtime($fileName) . '.php';

if (is_file($cacheFile)) {
return include $cacheFile;
$result = include $cacheFile;

if (\is_array($result)) {
return $result;
}

// When $result is not an array, the cache file is corrupted, we will delete it and have it regenerated
try {
File::delete($cacheFile);
} catch (FilesystemException $e) {
// We ignore the error, as the file is for caching only.
}
}

// This was required for https://github.com/joomla/joomla-cms/issues/17198 but not sure what server setup
Expand Down