Avoid crash in thread.inc.php when running huge expire.

This commit is contained in:
Retro_Guy 2023-08-08 05:54:15 -07:00
parent 224e58d5ab
commit c1c56ed528
2 changed files with 6 additions and 2 deletions

View File

@ -147,7 +147,9 @@ function thread_cache_removearticle($group,$id) {
// now lets rebuild the tree...
if(isset($value->answers))
foreach ($value->answers as $key => $answer) {
$thread[$answer]->isAnswer=false;
if(isset($thread[$answer])) {
$thread[$answer]->isAnswer=false;
}
}
if(isset($value->references))
foreach ($value->references as $reference) {

View File

@ -76,7 +76,9 @@ file_put_contents($logfile, "\n".format_log_date()." ".$config_name." ".$group."
echo "Expiring: ".$break[4]." IN: ".$group." #".$break[0]."\r\n";
file_put_contents($logfile, "\n".format_log_date()." ".$config_name." ".$group." Expiring: ".$break[4], FILE_APPEND);
// Remove article from tradspool:
unlink($spooldir.'/articles/'.$grouppath.'/'.$break[0]);
if(is_file($spooldir.'/articles/'.$grouppath.'/'.$break[0])) {
unlink($spooldir.'/articles/'.$grouppath.'/'.$break[0]);
}
thread_cache_removearticle($group,$break[4]);
continue;
} else {