Always set the description - fixes #24

This commit is contained in:
2023-10-08 19:23:46 +02:00
parent 5a3e23de49
commit 4dcf1fcfd5
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ function check(string $link, string $phishing_link): void
if(!empty($links) && !empty($phishing_links)){
$phishings=$db->prepare('INSERT IGNORE INTO ' . PREFIX . 'phishing (onion_id, original) VALUES ((SELECT id FROM onions WHERE md5sum=?), ?);');
$select=$db->prepare('SELECT id FROM ' . PREFIX . 'onions WHERE md5sum=?;');
$insert=$db->prepare('INSERT INTO ' . PREFIX . 'onions (address, md5sum, timeadded, timechanged) VALUES (?, ?, ?, ?);');
$insert=$db->prepare('INSERT INTO ' . PREFIX . 'onions (address, md5sum, timeadded, timechanged, description) VALUES (?, ?, ?, ?, "");');
$update=$db->prepare('UPDATE ' . PREFIX . 'onions SET locked=1, timechanged=? WHERE md5sum=?;');
preg_match_all('~(https?://)?([a-z0-9]*\.)?([a-z2-7]{55}d).onion(/[^\s><"]*)?~i', $links, $addr);
preg_match_all('~(https?://)?([a-z0-9]*\.)?([a-z2-7]{55}d).onion(/[^\s><"]*)?~i', $phishing_links, $phishing_addr);

View File

@ -90,7 +90,7 @@ function add_onions(&$onions, $db): void
}
}
$time=time();
$insert=$db->prepare('INSERT INTO ' . PREFIX . 'onions (address, md5sum, timeadded, timechanged) VALUES (?, ?, ?, ?);');
$insert=$db->prepare('INSERT INTO ' . PREFIX . 'onions (address, md5sum, timeadded, timechanged, description) VALUES (?, ?, ?, ?, "");');
$db->beginTransaction();
foreach($onions as $md5=>$addr){
$insert->execute([$addr, $md5, $time, $time]);