diff --git a/www/footer.php b/www/footer.php index 7d2287c..be62c77 100644 --- a/www/footer.php +++ b/www/footer.php @@ -10,7 +10,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { $oldcatname=""; - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { + while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) { $data[0]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[0]); // PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES! $data[0] = htmlspecialchars($data[0]); diff --git a/www/header.php b/www/header.php index 8abc7c8..ae4041e 100644 --- a/www/header.php +++ b/www/header.php @@ -8,7 +8,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { $oldcatname=""; - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { + while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) { //PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES! $data[0] = htmlspecialchars($data[0]); @@ -40,6 +40,9 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { if (str_contains(strtolower($data[5]), strtolower($query)) or str_contains(strtolower($data[3]), strtolower($query)) or str_contains(strtolower($data[2]), strtolower($query)) or str_contains(strtolower($data[1]), strtolower($query))) { $resultcount++; for ($c=0; $c < $num; $c++) { // iterate over each row + if ($data[7] == 0.0){ + continue; + }else{ echo "
Search query must be between ' . $min_length . " and " . $max_length . " characters.
"; } + ?>