mirror of
http://git.nowherejezfoltodf4jiyl6r56jnzintap5vyjlia7fkirfsnfizflqd.onion/nihilist/darknet-lantern.git
synced 2025-05-16 20:26:58 +00:00
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:
parent
13d39dc5c2
commit
46bd00a05a
3 changed files with 17 additions and 11 deletions
|
@ -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]);
|
||||
|
|
|
@ -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 "<tr>"; // 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] . ' </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[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"){
|
||||
echo "✔️" ;
|
||||
}else{
|
||||
|
@ -91,7 +95,7 @@ if (!preg_match("~^(?:f|ht)tps?://~i", $data[3])) {
|
|||
}
|
||||
}
|
||||
echo "</tr>"; // end html table row
|
||||
}
|
||||
}}
|
||||
echo "\n</table></center>";
|
||||
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++;
|
||||
|
||||
|
|
|
@ -9,18 +9,19 @@
|
|||
<meta property="og:title" content="Darknet Lantern" />
|
||||
<meta property="og:type" content="website" />
|
||||
<!-- // 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 -->
|
||||
<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" />
|
||||
<!-- // 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="icon" href="/img/logo-favicon.png">
|
||||
</head>
|
||||
<body>
|
||||
<div class="width-class">
|
||||
<?php
|
||||
|
||||
require("header.php");
|
||||
$min_length = 1;
|
||||
$max_length = 32;
|
||||
|
@ -44,7 +45,7 @@ require("header.php");
|
|||
|
||||
|
||||
<?php
|
||||
$sensitive = $_GET['sensitive'];
|
||||
$sensitive = $_GET['sensitive'];
|
||||
if ($sensitive == 1){
|
||||
//echo "<p>Sensitive ON " . $sensitive . "</p>";
|
||||
$sensitive=1;
|
||||
|
@ -95,6 +96,7 @@ require("header.php");
|
|||
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>";
|
||||
}
|
||||
|
||||
?>
|
||||
</div>
|
||||
<?php
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue