issue #49: link with status 0.0 now removes the whole line and add fixes with issues for php8.4

This commit is contained in:
SovereigntyIsNotFreedom 2025-04-11 09:04:52 +01:00
parent 13d39dc5c2
commit 46bd00a05a
3 changed files with 17 additions and 11 deletions

View file

@ -10,7 +10,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
$oldcatname=""; $oldcatname="";
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) {
$data[0]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[0]); $data[0]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[0]);
// PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES! // PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES!
$data[0] = htmlspecialchars($data[0]); $data[0] = htmlspecialchars($data[0]);

View file

@ -8,7 +8,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
$oldcatname=""; $oldcatname="";
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) {
//PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES! //PREVENT ALL MALICIOUS PHP PAYLOADS FROM BEING EXECUTED FROM CSV FILES!
$data[0] = htmlspecialchars($data[0]); $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))) { 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++; $resultcount++;
for ($c=0; $c < $num; $c++) { // iterate over each row for ($c=0; $c < $num; $c++) { // iterate over each row
if ($data[7] == 0.0){
continue;
}else{
echo "<tr>"; // begin html table row for that Category echo "<tr>"; // begin html table row for that Category
// if the row is the first one (name url status score) only display (Name Status Score): // if the row is the first one (name url status score) only display (Name Status Score):
// display the contents of a csv row // 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 $urllink . '"> '; // display the link
echo $data[2] . ' </a></p></td><td class="description">'; // display the link title and close the a href and first cell, open the second cell echo $data[2] . ' </a></p></td><td class="description">'; // display the link title and close the a href and first cell, open the second cell
echo $data[5] . " </td><td>"; // OPTIONAL: display the description column echo $data[5] . " </td><td>"; // OPTIONAL: display the description column
echo $data[7] . " </td><td>"; // display the score and close the second cell, open the third cell echo $data[7] . " </td><td>"; // display the score and close the second cell, open the third cell
if($data[6] == "YES"){ if($data[6] == "YES"){
echo "✔️" ; echo "✔️" ;
}else{ }else{
@ -91,7 +95,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) {
} }
} }
echo "</tr>"; // end html table row echo "</tr>"; // end html table row
} }}
echo "\n</table></center>"; echo "\n</table></center>";
fclose($handle); fclose($handle);
} }
@ -130,7 +134,7 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
$oldcatname=""; $oldcatname="";
while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",",'"','\\')) !== FALSE) {
$num = count($data); $num = count($data);
$row++; $row++;

View file

@ -9,18 +9,19 @@
<meta property="og:title" content="Darknet Lantern" /> <meta property="og:title" content="Darknet Lantern" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<!-- // Now displays the url of the instance --> <!-- // Now displays the url of the instance -->
<meta property="og:url" content="<?php echo htmlspecialchars($_SERVER['HTTP_HOST']); ?>" /> <meta property="og:url" content="<?php echo htmlspecialchars($_SERVER['SERVER_NAME']); ?>" />
<!-- // Default images for previews --> <!-- // Default images for previews -->
<meta property="og:image:url" content="<?php echo htmlspecialchars($_SERVER['HTTP_HOST']) . "/img/logo-large.png"; ?>" /> <meta property="og:image:url" content="<?php echo htmlspecialchars($_SERVER['SERVER_NAME']) . "/img/logo-large.png"; ?>" />
<meta property="og:locale" content="en_US" /> <meta property="og:locale" content="en_US" />
<!-- // This tells search engines which URL should be considered the original source when multiple URLs contain the same content. --> <!-- // This tells search engines which URL should be considered the original source when multiple URLs contain the same content. -->
<link rel="canonical" href="<?php echo htmlspecialchars($_SERVER['HTTP_HOST']); ?>" /> <link rel="canonical" href="<?php echo htmlspecialchars($_SERVER['SERVER_NAME']); ?>" />
<link rel="stylesheet" type="text/css" href="style.css"> <link rel="stylesheet" type="text/css" href="style.css">
<link rel="icon" href="/img/logo-favicon.png"> <link rel="icon" href="/img/logo-favicon.png">
</head> </head>
<body> <body>
<div class="width-class"> <div class="width-class">
<?php <?php
require("header.php"); require("header.php");
$min_length = 1; $min_length = 1;
$max_length = 32; $max_length = 32;
@ -43,8 +44,8 @@ require("header.php");
</form> </form>
<?php <?php
$sensitive = $_GET['sensitive']; $sensitive = $_GET['sensitive'];
if ($sensitive == 1){ if ($sensitive == 1){
//echo "<p>Sensitive ON " . $sensitive . "</p>"; //echo "<p>Sensitive ON " . $sensitive . "</p>";
$sensitive=1; $sensitive=1;
@ -95,6 +96,7 @@ require("header.php");
else { // if query length is less than minimum or more than maximum else { // if query length is less than minimum or more than maximum
echo '</br></br><img src="img/logo-large.png"><p>Search query must be between ' . $min_length . " and " . $max_length . " characters.</p>"; echo '</br></br><img src="img/logo-large.png"><p>Search query must be between ' . $min_length . " and " . $max_length . " characters.</p>";
} }
?> ?>
</div> </div>
<?php <?php