pass by reference, closes #858

This commit is contained in:
El RIDO 2025-03-11 07:59:10 +01:00
parent e67972417e
commit 629f263cf5
No known key found for this signature in database
GPG key ID: 0F5C940A6BD81F92
12 changed files with 37 additions and 35 deletions

View file

@ -219,7 +219,8 @@ class GoogleCloudStorage extends AbstractData
$prefix = $this->_getKey($pasteid) . '/discussion/';
try {
foreach ($this->_bucket->objects(array('prefix' => $prefix)) as $key) {
$comment = JSON::decode($this->_bucket->object($key->name())->downloadAsString());
$data = $this->_bucket->object($key->name())->downloadAsString();
$comment = Json::decode($data);
$comment['id'] = basename($key->name());
$slot = $this->getOpenSlot($comments, (int) $comment['meta']['created']);
$comments[$slot] = $comment;