Revert "Temporarily Revert "Remove telegrams" due to critical bug with posting"
This commit is contained in:
35
post.php
35
post.php
@@ -1216,27 +1216,6 @@ if (isset($_POST['delete'])) {
|
||||
|
||||
if (!$post['mod']) header('X-Associated-Content: "' . $redirect . '"');
|
||||
|
||||
// Any telegrams to show?
|
||||
$query = prepare('SELECT * FROM ``telegrams`` WHERE ``ip`` = :ip AND ``seen`` = 0');
|
||||
$query->bindValue(':ip', $_SERVER['REMOTE_ADDR']);
|
||||
$query->execute() or error(db_error($query));
|
||||
$telegrams = $query->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
if (count($telegrams) > 0)
|
||||
goto skip_redirect;
|
||||
|
||||
if (!isset($_POST['json_response'])) {
|
||||
header('Location: ' . $redirect, true, $config['redirect_http']);
|
||||
} else {
|
||||
header('Content-Type: text/json; charset=utf-8');
|
||||
echo json_encode(array(
|
||||
'redirect' => $redirect,
|
||||
'noko' => $noko,
|
||||
'id' => $id
|
||||
));
|
||||
}
|
||||
skip_redirect:
|
||||
|
||||
|
||||
if ($config['try_smarter'] && $post['op'])
|
||||
$build_pages = range(1, $config['max_pages']);
|
||||
@@ -1248,20 +1227,6 @@ if (isset($_POST['delete'])) {
|
||||
|
||||
buildIndex();
|
||||
|
||||
if (count($telegrams) > 0) {
|
||||
$ids = implode(', ', array_map(function($x) { return (int)$x['id']; }, $telegrams));
|
||||
query("UPDATE ``telegrams`` SET ``seen`` = 1 WHERE ``id`` IN({$ids})") or error(db_error());
|
||||
die(Element('page.html', array(
|
||||
'title' => _('Important message from Moderation'),
|
||||
'config' => $config,
|
||||
'body' => Element('important.html', array(
|
||||
'config' => $config,
|
||||
'redirect' => $redirect,
|
||||
'telegrams' => $telegrams,
|
||||
))
|
||||
)));
|
||||
}
|
||||
|
||||
// We are already done, let's continue our heavy-lifting work in the background (if we run off FastCGI)
|
||||
if (function_exists('fastcgi_finish_request'))
|
||||
@fastcgi_finish_request();
|
||||
|
||||
Reference in New Issue
Block a user