Allow graceful fail if message does not exist when access by message-id. Improve this in the future
This commit is contained in:
parent
81c083596d
commit
8bfcf9fbb3
@ -30,18 +30,20 @@
|
|||||||
$articles_dbh = article_db_open($database);
|
$articles_dbh = article_db_open($database);
|
||||||
$articles_query = $articles_dbh->prepare('SELECT * FROM articles WHERE msgid=:messageid');
|
$articles_query = $articles_dbh->prepare('SELECT * FROM articles WHERE msgid=:messageid');
|
||||||
$articles_query->execute(['messageid' => $id]);
|
$articles_query->execute(['messageid' => $id]);
|
||||||
|
$found = 0;
|
||||||
while ($row = $articles_query->fetch()) {
|
while ($row = $articles_query->fetch()) {
|
||||||
$id = $row['number'];
|
$id = $row['number'];
|
||||||
|
$found = 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$dbh = null;
|
$dbh = null;
|
||||||
|
if($found) {
|
||||||
$newurl = 'article-flat.php?id='.$id.'&group='.$group.'#'.$id;
|
$newurl = 'article-flat.php?id='.$id.'&group='.$group.'#'.$id;
|
||||||
// $newurl.='#'.$id;
|
|
||||||
|
|
||||||
header("Location: $newurl");
|
header("Location: $newurl");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_REQUEST["first"]))
|
if(isset($_REQUEST["first"]))
|
||||||
$first=$_REQUEST["first"];
|
$first=$_REQUEST["first"];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user