Return proper 430 if artice requested does not exist
This commit is contained in:
parent
037a09f376
commit
66c05e9f1f
@ -642,6 +642,10 @@ function get_article($article, $nntp_group) {
|
|||||||
}
|
}
|
||||||
if($CONFIG['article_database'] == '1') {
|
if($CONFIG['article_database'] == '1') {
|
||||||
$thisarticle=get_db_article($article, $nntp_group);
|
$thisarticle=get_db_article($article, $nntp_group);
|
||||||
|
if($thisarticle === FALSE) {
|
||||||
|
$msg.="430 no such article found\r\n";
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$thisgroup = $path."/".preg_replace('/\./', '/', $nntp_group);
|
$thisgroup = $path."/".preg_replace('/\./', '/', $nntp_group);
|
||||||
if(!file_exists($thisgroup."/".$article)) {
|
if(!file_exists($thisgroup."/".$article)) {
|
||||||
@ -664,6 +668,7 @@ function get_article($article, $nntp_group) {
|
|||||||
function get_db_article($article, $group) {
|
function get_db_article($article, $group) {
|
||||||
global $nntp_article,$nntp_group,$config_dir,$path,$groupconfig,$config_name,$spooldir;
|
global $nntp_article,$nntp_group,$config_dir,$path,$groupconfig,$config_name,$spooldir;
|
||||||
$msg2="";
|
$msg2="";
|
||||||
|
$ok_article = 0;
|
||||||
$database = $spooldir.'/'.$nntp_group.'-articles.db3';
|
$database = $spooldir.'/'.$nntp_group.'-articles.db3';
|
||||||
$dbh = article_db_open($database);
|
$dbh = article_db_open($database);
|
||||||
// Use article pointer
|
// Use article pointer
|
||||||
@ -677,6 +682,7 @@ function get_db_article($article, $group) {
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
while($found = $stmt->fetch()) {
|
while($found = $stmt->fetch()) {
|
||||||
$msg2 = $found['article'];
|
$msg2 = $found['article'];
|
||||||
|
$ok_article = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -685,14 +691,18 @@ function get_db_article($article, $group) {
|
|||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
while($found = $stmt->fetch()) {
|
while($found = $stmt->fetch()) {
|
||||||
$msg2 = $found['article'];
|
$msg2 = $found['article'];
|
||||||
|
$ok_article = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$dbh = null;
|
$dbh = null;
|
||||||
|
if($ok_article !== 1) {
|
||||||
|
return FALSE;
|
||||||
|
} else {
|
||||||
$thisarticle = preg_split("/\r\n|\n|\r/", trim($msg2));
|
$thisarticle = preg_split("/\r\n|\n|\r/", trim($msg2));
|
||||||
return $thisarticle;
|
return $thisarticle;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function get_header($article, $nntp_group) {
|
function get_header($article, $nntp_group) {
|
||||||
global $CONFIG,$nntp_article,$config_dir,$path,$groupconfig,$config_name,$spooldir;
|
global $CONFIG,$nntp_article,$config_dir,$path,$groupconfig,$config_name,$spooldir;
|
||||||
@ -703,6 +713,10 @@ function get_header($article, $nntp_group) {
|
|||||||
}
|
}
|
||||||
if($CONFIG['article_database'] == '1') {
|
if($CONFIG['article_database'] == '1') {
|
||||||
$thisarticle=get_db_article($article, $nntp_group);
|
$thisarticle=get_db_article($article, $nntp_group);
|
||||||
|
if($thisarticle === FALSE) {
|
||||||
|
$msg.="430 no such article found\r\n";
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// By Message-ID
|
// By Message-ID
|
||||||
if(!is_numeric($article)) {
|
if(!is_numeric($article)) {
|
||||||
@ -759,6 +773,10 @@ function get_body($article, $nntp_group) {
|
|||||||
}
|
}
|
||||||
if($CONFIG['article_database'] == '1') {
|
if($CONFIG['article_database'] == '1') {
|
||||||
$thisarticle=get_db_article($article, $nntp_group);
|
$thisarticle=get_db_article($article, $nntp_group);
|
||||||
|
if($thisarticle === FALSE) {
|
||||||
|
$msg.="430 no such article found\r\n";
|
||||||
|
return $msg;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// By Message-ID
|
// By Message-ID
|
||||||
if(!is_numeric($article)) {
|
if(!is_numeric($article)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user