Merge pull request #1712 from nextcloud/fix/noid/fix-out-of-range-ancestor

filter out of range ancestor
pull/1713/head
Maxence Lange 2023-04-03 15:04:11 -01:00 zatwierdzone przez GitHub
commit a3b4a222b4
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 7 dodań i 4 usunięć

Wyświetl plik

@ -355,7 +355,6 @@ class StreamService {
* @param int $nid
*
* @return array
* @throws StreamNotFoundException
*/
public function getContextByNid(int $nid): array {
$curr = $post = $this->streamRequest->getStreamByNid($nid);
@ -366,9 +365,13 @@ class StreamService {
break;
}
$curr = $this->streamRequest->getStreamById($curr->getInReplyTo());
$curr->setExportFormat(ACore::FORMAT_LOCAL);
$ancestors[] = $curr;
try {
$curr = $this->streamRequest->getStreamById($curr->getInReplyTo(), true);
$curr->setExportFormat(ACore::FORMAT_LOCAL);
$ancestors[] = $curr;
} catch (StreamNotFoundException $e) {
break; // ancestor might be out of range for viewer
}
}
return [