From 3554747079ca8de49aba14e6363e424e495ef7d7 Mon Sep 17 00:00:00 2001 From: jakani24 Date: Sun, 10 Mar 2024 11:28:00 +0100 Subject: [PATCH] Update compile_database.php --- .../cyberhex-code/api/php/database/compile_database.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/cyberhex-code/api/php/database/compile_database.php b/src/server/cyberhex-code/api/php/database/compile_database.php index f6016a5..6ac3625 100644 --- a/src/server/cyberhex-code/api/php/database/compile_database.php +++ b/src/server/cyberhex-code/api/php/database/compile_database.php @@ -11,7 +11,7 @@ function sort_hashes($inputFile, $excluded) { $batchedHashes = array(); // Read each line from the input file - while (($line = fgets($handle)) !== false) { + while (($line = fgets($handle)) !== false && !feof($handle)) { // Remove leading/trailing whitespace and split the line into words $hash = trim($line); @@ -27,7 +27,7 @@ function sort_hashes($inputFile, $excluded) { $filename = "/var/www/html/database_srv/".$prefix . ".jdbf"; // Add the hash to the batched array - $batchedHashes[$filename][] = $line . PHP_EOL; + $batchedHashes[$filename][] = $line; } // Close the input file handle