mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-12 14:58:42 +00:00
LOC fix if file is corrupted
This commit is contained in:
parent
d2de70d356
commit
62f0a8da09
|
|
@ -642,10 +642,14 @@ class Repository
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$fh = fopen($path = $this->getDirectoryPath() . ($this->bare ? '/' : '/../') . $line, 'r');
|
if(!file_exists($path = $this->getDirectoryPath() . ($this->bare ? '/' : '/../') . $line)) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
$fh = fopen($path, 'r');
|
||||||
|
|
||||||
if (!$fh) {
|
if (!$fh) {
|
||||||
throw new PathException($path);
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (!feof($fh)) {
|
while (!feof($fh)) {
|
||||||
|
|
@ -844,6 +848,7 @@ class Repository
|
||||||
throw new \Exception('Invalid commit id');
|
throw new \Exception('Invalid commit id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// todo: validate if array values are all initialized
|
||||||
$author = explode(':', $lines[1]);
|
$author = explode(':', $lines[1]);
|
||||||
$author = explode('<', trim($author[1]));
|
$author = explode('<', trim($author[1]));
|
||||||
$date = substr($lines[2], 6);
|
$date = substr($lines[2], 6);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user