More fixes for php8.2

This commit is contained in:
Retro_Guy 2023-04-16 21:48:38 -07:00
parent 42d8a4bc18
commit 7db2a31bc9
5 changed files with 11 additions and 11 deletions

View File

@ -232,13 +232,12 @@ function message_post($subject,$from,$newsgroups,$ref,$body,$encryptthis=null,$e
$weg=line_read($ns); $weg=line_read($ns);
$t = explode(' ', $weg); $t = explode(' ', $weg);
if($t[0] != "340") { if($t[0] != "340") {
nntp_close($ns); nntp_close($ns);
return $weg; return $weg;
} }
fputs($ns,'Subject: '.encode_subject($subject)."\r\n"); fputs($ns,'Subject: '.encode_subject($subject)."\r\n");
// For Synchronet use // For Synchronet use
if (isset($fromname) && (isset($CONFIG['synchronet']) && ($CONFIG['synchronet'] == true))) { if (isset($fromname) && (isset($CONFIG['synchronet']) && ($CONFIG['synchronet'] == true))) {
// if ( isset($fromname) && isset($CONFIG['synchronet']) ) { // if ( isset($fromname) && isset($CONFIG['synchronet']) ) {

View File

@ -194,6 +194,7 @@ function thread_overview_interpret($line,$overviewformat,$groupname) {
// $over=explode("\t",$line,count($overviewfmt)-1); // $over=explode("\t",$line,count($overviewfmt)-1);
$over=explode("\t",$line); $over=explode("\t",$line);
//$article=new headerType; //$article=new headerType;
$article = (object)[];
for ($i=0; $i<count($overviewfmt)-1; $i++) { for ($i=0; $i<count($overviewfmt)-1; $i++) {
if ($overviewfmt[$i]=="Subject:") { if ($overviewfmt[$i]=="Subject:") {
$subject=preg_replace('/\[doctalk\]/i','',headerDecode($over[$i+1])); $subject=preg_replace('/\[doctalk\]/i','',headerDecode($over[$i+1]));
@ -422,9 +423,9 @@ function thread_load_newsserver(&$ns,$groupname,$poll) {
} }
// write information about the last article to the spool-directory // write information about the last article to the spool-directory
$infofile=fopen($spooldir."/".$groupname."-lastarticleinfo.dat","w"); $infofile=fopen($spooldir."/".$groupname."-lastarticleinfo.dat","w");
$lastarticleinfo->from=$article->from; $lastarticleinfo['from']=$article->from;
$lastarticleinfo->date=$article->date; $lastarticleinfo['date']=$article->date;
$lastarticleinfo->name=$article->name; $lastarticleinfo['name']=$article->name;
fputs($infofile,serialize($lastarticleinfo)); fputs($infofile,serialize($lastarticleinfo));
fclose($infofile); fclose($infofile);
} }

View File

@ -59,7 +59,7 @@ function import_articles($group) {
# Prepare databases # Prepare databases
// Overview db // Overview db
$new_article_dbh = article_db_open($spooldir.'/'.$group.'-articles.db3-new'); $new_article_dbh = article_db_open($spooldir.'/'.$group.'-articles.db3-new');
$new_article_sql = 'INSERT INTO articles(newsgroup, number, msgid, date, name, subject, article, search_snippet) VALUES(?,?,?,?,?,?,?,?)'; $new_article_sql = 'INSERT OR IGNORE INTO articles(newsgroup, number, msgid, date, name, subject, article, search_snippet) VALUES(?,?,?,?,?,?,?,?)';
$new_article_stmt = $new_article_dbh->prepare($new_article_sql); $new_article_stmt = $new_article_dbh->prepare($new_article_sql);
$database = $spooldir.'/articles-overview.db3'; $database = $spooldir.'/articles-overview.db3';
$table = 'overview'; $table = 'overview';
@ -69,7 +69,7 @@ function import_articles($group) {
$clear_stmt->execute(); $clear_stmt->execute();
unlink($overview_file); unlink($overview_file);
$sql = 'INSERT INTO '.$table.'(newsgroup, number, msgid, date, name, subject) VALUES(?,?,?,?,?,?)'; $sql = 'INSERT OR IGNORE INTO '.$table.'(newsgroup, number, msgid, date, name, subject) VALUES(?,?,?,?,?,?)';
$stmt = $dbh->prepare($sql); $stmt = $dbh->prepare($sql);
// Incoming db // Incoming db
$article_dbh = article_db_open($spooldir.'/'.$group.'-articles.db3'); $article_dbh = article_db_open($spooldir.'/'.$group.'-articles.db3');

View File

@ -184,7 +184,7 @@ function get_articles($ns, $group) {
$stmt = $dbh->prepare($sql); $stmt = $dbh->prepare($sql);
if($CONFIG['article_database'] == '1') { if($CONFIG['article_database'] == '1') {
$article_dbh = article_db_open($spooldir.'/'.$group.'-articles.db3'); $article_dbh = article_db_open($spooldir.'/'.$group.'-articles.db3');
$article_sql = 'INSERT INTO articles(newsgroup, number, msgid, date, name, subject, article, search_snippet) VALUES(?,?,?,?,?,?,?,?)'; $article_sql = 'INSERT OR IGNORE INTO articles(newsgroup, number, msgid, date, name, subject, article, search_snippet) VALUES(?,?,?,?,?,?,?,?)';
$article_stmt = $article_dbh->prepare($article_sql); $article_stmt = $article_dbh->prepare($article_sql);
} }
# Pull articles and save them in our spool # Pull articles and save them in our spool
@ -318,7 +318,7 @@ function get_articles($ns, $group) {
$bytes = $bytes + ($lines * 2); $bytes = $bytes + ($lines * 2);
// Don't spool article if $banned=1 // Don't spool article if $banned=1
if($banned == 1) { if($banned == 1) {
@fclose($articleHandle); // @fclose($articleHandle);
unlink($grouppath."/".$local); unlink($grouppath."/".$local);
file_put_contents($logfile, "\n".format_log_date()." ".$config_name." Skipping: ".$CONFIG['remote_server']." ".$group.":".$article." user: ".$from[1]." is banned", FILE_APPEND); file_put_contents($logfile, "\n".format_log_date()." ".$config_name." Skipping: ".$CONFIG['remote_server']." ".$group.":".$article." user: ".$from[1]." is banned", FILE_APPEND);
$article++; $article++;

View File

@ -126,7 +126,7 @@ echo '</table>';
$userfile=$spooldir.'/'.$user.'-articleviews.dat'; $userfile=$spooldir.'/'.$user.'-articleviews.dat';
if(is_file($userfile)) { if(is_file($userfile)) {
$userdata = unserialize(file_get_contents($userfile)); $userdata = unserialize(file_get_contents($userfile));
ksort($userdata); // ksort($userdata);
} }
// Apply Config // Apply Config
if(isset($_POST['command']) && $_POST['command'] == 'SaveConfig') { if(isset($_POST['command']) && $_POST['command'] == 'SaveConfig') {