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 ""; // begin html table row for that Category // if the row is the first one (name url status score) only display (Name Status Score): // display the contents of a csv row @@ -76,7 +79,8 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) { echo $urllink . '"> '; // display the link echo $data[2] . '

'; // display the link title and close the a href and first cell, open the second cell echo $data[5] . " "; // OPTIONAL: display the description column - echo $data[7] . " "; // display the score and close the second cell, open the third cell + echo $data[7] . " "; // display the score and close the second cell, open the third cell + if($data[6] == "YES"){ echo "✔️" ; }else{ @@ -91,7 +95,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) { } } echo ""; // end html table row - } + }} echo "\n"; fclose($handle); } @@ -130,7 +134,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) { $oldcatname=""; - while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { + while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) { $num = count($data); $row++; diff --git a/www/index.php b/www/index.php index 2230e9c..c091717 100644 --- a/www/index.php +++ b/www/index.php @@ -9,18 +9,19 @@ - + - " /> + " /> - +
- -Sensitive ON " . $sensitive . "

"; $sensitive=1; @@ -95,6 +96,7 @@ require("header.php"); else { // if query length is less than minimum or more than maximum echo '

Search query must be between ' . $min_length . " and " . $max_length . " characters.

"; } + ?>