mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-07-10 05:54:41 +02:00
fix: Call to a member function find() on bool (#3146)
* fix: Call to a member function find() on bool Happens when defaultLinkTo() is passed the empty string. * fix: prevent exception in defaultLinkTo() when passed the empty string * refactor
This commit is contained in:
parent
001427243c
commit
dbab225fd2
2 changed files with 27 additions and 14 deletions
|
@ -158,7 +158,10 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
|
||||
$item['timestamp'] = $description->created_at ?? $description->updated_at;
|
||||
|
||||
$item['author'] = $this->parseAuthor($description_html);
|
||||
$author = $this->parseAuthor($description_html);
|
||||
if ($author) {
|
||||
$item['author'] = $author;
|
||||
}
|
||||
|
||||
$item['title'] = $description->title;
|
||||
$item['content'] = markdownToHtml($description->description);
|
||||
|
@ -179,7 +182,10 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
|
||||
$item['timestamp'] = $description_html->find('.merge-request-details time', 0)->datetime;
|
||||
|
||||
$item['author'] = $this->parseAuthor($description_html);
|
||||
$author = $this->parseAuthor($description_html);
|
||||
if ($author) {
|
||||
$item['author'] = $author;
|
||||
}
|
||||
|
||||
$item['title'] = 'Merge Request ' . $description->title;
|
||||
$item['content'] = markdownToHtml($description->description);
|
||||
|
@ -205,6 +211,9 @@ class GitlabIssueBridge extends BridgeAbstract
|
|||
|
||||
$authors = $description_html->find('.issuable-meta a.author-link, .merge-request a.author-link');
|
||||
$editors = $description_html->find('.edited-text a.author-link');
|
||||
if ($authors === [] && $editors === []) {
|
||||
return null;
|
||||
}
|
||||
$author_str = implode(' ', $authors);
|
||||
if ($editors) {
|
||||
$author_str .= ', ' . implode(' ', $editors);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue