Fix read file on empty files

This commit is contained in:
Markus Baumer
2024-05-07 20:38:43 +02:00
parent 43ae4c785d
commit 8b5eb3f66d
+1 -1
View File
@@ -17,7 +17,7 @@ if (!empty($_COOKIE['unraid_'.md5($server_name)])) {
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));