Update sources and a few small bugfixes

This commit is contained in:
Daniel Winzen
2021-04-21 19:30:29 +02:00
parent a208bd568c
commit cab72ea840
7 changed files with 21 additions and 20 deletions

View File

@ -53,12 +53,12 @@ foreach($curl_handles as $handle){
$header = substr($content, 0, $header_size);
$content = substr($content, $header_size);
// update description to title, if not yet set
if(($onion['description']==='' || $onion['description']==='Site hosted by Daniel\'s hosting service') && preg_match('~<title>([^<]+)</title>~i', $content, $match)){
if(in_array($onion['description'], ['', 'Site hosted by Daniel\'s hosting service', ' - SCAM']) && preg_match('~<title>([^<]+)</title>~i', $content, $match)){
$desc=preg_replace("/(\r?\n|\r\n?)/", '<br>', htmlspecialchars(html_entity_decode(trim($match[1]))));
if($desc!=='Site hosted by Daniel\'s hosting service'){
$desc_online_stmt->execute([$desc, $onion['md5sum'], $time]);
$desc_online_stmt->execute([$desc, $time, $onion['md5sum']]);
}else{
$desc_empty_stmt->execute([$desc, $onion['md5sum'], $time]);
$desc_empty_stmt->execute([$desc, $time, $onion['md5sum']]);
}
}
$online_stmt->execute([$time, $onion['md5sum']]);