mirror of
https://github.com/unraid/webgui.git
synced 2026-01-07 10:10:05 -06:00
Merge pull request #1717 from baumerdev/fix_readfile_on_empty_files
Fix Error 500 on login / fix read file on empty files
This commit is contained in:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user