diff --git a/SimpleX/__pycache__/regex_simplexlinks.cpython-311.pyc b/SimpleX/__pycache__/regex_simplexlinks.cpython-311.pyc
deleted file mode 100644
index 1fe6ae3..0000000
Binary files a/SimpleX/__pycache__/regex_simplexlinks.cpython-311.pyc and /dev/null differ
diff --git a/SimpleX/__pycache__/utils.cpython-311.pyc b/SimpleX/__pycache__/utils.cpython-311.pyc
deleted file mode 100644
index 965119d..0000000
Binary files a/SimpleX/__pycache__/utils.cpython-311.pyc and /dev/null differ
diff --git a/SimpleX/__pycache__/utils.cpython-313.pyc b/SimpleX/__pycache__/utils.cpython-313.pyc
deleted file mode 100644
index d46565c..0000000
Binary files a/SimpleX/__pycache__/utils.cpython-313.pyc and /dev/null differ
diff --git a/scripts/lantern.py b/scripts/lantern.py
index 43e5c8c..a4d973d 100644
--- a/scripts/lantern.py
+++ b/scripts/lantern.py
@@ -229,8 +229,28 @@ Maintenance:
newrow=[instance,category,name,url,sensi,desc,'YES','100']
print_colors(f"[+] NEWROW= {newrow}")
# (rest is automatic: status, score, instance is = '' because it is your own instance)
- # TODO check if the entry doesnt already exist in verified.csv and in unverified.csv
- # if it doesnt exist, add it into unverified.csv
+ # delete existing entries in verified.csv
+ vdf_same_url_filter = vdf["URL"] == url # check for same url
+ vdf_same_url_filter_count = vdf_same_url_filter.sum() # total url matches
+ if vdf_same_url_filter_count > 0:
+ print(f"Found {vdf_same_url_filter_count} row(s) with the same url in verified.csv")
+ for index, row in vdf[vdf_same_url_filter].iterrows():
+ print_colors(f"[+] ROW[{index}]= {list(row)}")
+ vdf = vdf[~vdf_same_url_filter].reset_index(drop=True) # keep only entries that do not match filter
+ print(f"Deleted {vdf_same_url_filter_count} row(s) with the same url in verified.csv")
+ if desc == '': # if the description is empty = it means that it goes in unverified.csv, so save modified verified.csv file now
+ vdf.to_csv(verifiedcsvfile, index=False)
+ # delete existing entries in unverified.csv
+ uvdf_same_url_filter = uvdf["URL"] == url # check for same url
+ uvdf_same_url_filter_count = uvdf_same_url_filter.sum() # total url matches
+ if uvdf_same_url_filter_count > 0:
+ print(f"Found {uvdf_same_url_filter_count} row(s) with the same url in unverified.csv")
+ for index, row in uvdf[uvdf_same_url_filter].iterrows():
+ print_colors(f"[+] ROW[{index}]= {list(row)}")
+ uvdf = uvdf[~uvdf_same_url_filter].reset_index(drop=True) # keep only entries that do not match filter
+ print(f"Deleted {uvdf_same_url_filter_count} row(s) with the same url in unverified.csv")
+ if desc != '': # if the description isnt empty = it means that it goes in verified.csv, so save modified unverified.csv file now
+ uvdf.to_csv(unverifiedcsvfile, index=False)
if desc == '': # if the description is empty = it means that it goes in unverified.csv
print("Adding new row in unverified.csv since description is empty")
uvdf.loc[-1] = newrow # adding a row
@@ -1438,3 +1458,4 @@ Maintenance:
if __name__ == '__main__':
main()
+
diff --git a/www/footer.php b/www/footer.php
index f72aa2d..3411e03 100644
--- a/www/footer.php
+++ b/www/footer.php
@@ -11,24 +11,11 @@ if (($handle = fopen($csvfile, "r")) !== FALSE) {
$oldcatname="";
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]);
- $data[1] = htmlspecialchars($data[1]);
- $data[2] = htmlspecialchars($data[2]);
- $data[3] = htmlspecialchars($data[3]);
- $data[4] = htmlspecialchars($data[4]);
- $data[5] = htmlspecialchars($data[5]);
- $data[6] = htmlspecialchars($data[6]);
- $data[7] = htmlspecialchars($data[7]);
-
- $data[1]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[1]);
- $data[2]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[2]);
- $data[3]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[3]);
- $data[4]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[4]);
- $data[5]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[5]);
- $data[6]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[6]);
- $data[7]=preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[7]);
+ for ($i = 0; $i < count($data); $i++) {
+ $data[$i] = htmlspecialchars($data[$i]);
+ $data[$i] = preg_replace("/[^a-zA-Z0-9:\/.\ -✔️❌]/", "", $data[$i]);
+ }
$num = count($data);
//echo "