1
0
mirror of https://github.com/vichan-devel/vichan.git synced 2025-02-26 06:58:26 +01:00

[SECURITY] JSON replies were leaking data for OPs of threads

This commit is contained in:
8chan 2015-09-24 13:20:55 -07:00
parent 0482c7918b
commit 5d8bd516e9

View File

@ -103,7 +103,14 @@ class Api {
$fields = $threadsPage ? $this->threadsPageFields : $this->postFields; $fields = $threadsPage ? $this->threadsPageFields : $this->postFields;
$this->translateFields($fields, $post, $apiPost); $this->translateFields($fields, $post, $apiPost);
if ($this->config['poster_ids']) $apiPost['id'] = poster_id($post->ip, $post->thread, $board['uri']); if ($this->config['poster_ids']) {
if ($post->thread) {
$apiPost['id'] = poster_id($post->ip, $post->thread, $board['uri']);
} else {
$apiPost['id'] = poster_id($post->ip, $post->id, $board['uri']);
}
}
if ($threadsPage) return $apiPost; if ($threadsPage) return $apiPost;
// Handle country field // Handle country field