1
0
Fork 0

Fix corrupt caches for svn driver, fixes #10751

pull/10756/head
Jordi Boggiano 2022-04-27 21:30:21 +02:00
parent a0cc388952
commit cac2d076b1
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 7 additions and 0 deletions

View File

@ -137,6 +137,13 @@ class SvnDriver extends VcsDriver
{
if (!isset($this->infoCache[$identifier])) {
if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier.'.json')) {
// old cache files had '' stored instead of null due to af3783b5f40bae32a23e353eaf0a00c9b8ce82e2, so we make sure here that we always return null or array
// and fix outdated invalid cache files
if ($res === '""') {
$res = 'null';
$this->cache->write($identifier.'.json', json_encode(null));
}
return $this->infoCache[$identifier] = JsonFile::parseJson($res);
}