Fix bug in flash backup rate limiter (#880)

Don't try to read from an empty file
This commit is contained in:
ljm42
2024-05-07 17:11:36 -07:00
committed by GitHub
parent 9ae9d40f94
commit 521b4381f2

View File

@@ -126,7 +126,7 @@ function set_git_config($name, $value) {
function readFromFile($file): string {
$text = "";
if (file_exists($file)) {
if (file_exists($file) && filesize($file) > 0) {
$fp = fopen($file,"r");
if (flock($fp, LOCK_EX)) {
$text = fread($fp, filesize($file));