mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-03 12:06:40 -04:00
updating comment format to match defined JSON-LD API context
This commit is contained in:
parent
f21567133c
commit
22d0b1ec22
5 changed files with 16 additions and 10 deletions
|
@ -444,7 +444,6 @@ class zerobin
|
|||
$result['url'] = (
|
||||
array_key_exists('REQUEST_URI', $_SERVER) ? $_SERVER['REQUEST_URI'] : '/'
|
||||
) . '?' . $message;
|
||||
$result['@context'] = 'js/paste.jsonld';
|
||||
}
|
||||
$result += $other;
|
||||
$this->_json = json_encode($result);
|
||||
|
|
|
@ -177,8 +177,8 @@ class zerobin_data extends zerobin_abstract
|
|||
$comment = json_decode(file_get_contents($discdir . $filename));
|
||||
$items = explode('.', $filename);
|
||||
// Add some meta information not contained in file.
|
||||
$comment->meta->commentid = $items[1];
|
||||
$comment->meta->parentid = $items[2];
|
||||
$comment->id = $items[1];
|
||||
$comment->parentid = $items[2];
|
||||
|
||||
// Store in array
|
||||
$key = $this->getOpenSlot($comments, (int) $comment->meta->postdate);
|
||||
|
|
|
@ -378,15 +378,15 @@ class zerobin_db extends zerobin_abstract
|
|||
{
|
||||
$i = $this->getOpenSlot($comments, (int) $row['postdate']);
|
||||
$comments[$i] = new stdClass;
|
||||
$comments[$i]->id = $row['dataid'];
|
||||
$comments[$i]->parentid = $row['parentid'];
|
||||
$comments[$i]->data = $row['data'];
|
||||
$comments[$i]->meta = new stdClass;
|
||||
$comments[$i]->meta->postdate = (int) $row['postdate'];
|
||||
if (array_key_exists('nickname', $row))
|
||||
$comments[$i]->meta->nickname = $row['nickname'];
|
||||
if (array_key_exists('vizhash', $row))
|
||||
$comments[$i]->meta->vizhash = $row['vizhash'];
|
||||
$comments[$i]->meta->postdate = (int) $row['postdate'];
|
||||
$comments[$i]->meta->commentid = $row['dataid'];
|
||||
$comments[$i]->meta->parentid = $row['parentid'];
|
||||
}
|
||||
ksort($comments);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue