X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Ffeed%2FFeedBuilder.php;h=ed62af26e1c4b26ae4eb481e37ab32f0a5d9988a;hb=302662797cb5e8ac6579a99297ceae301f7927a6;hp=f6def6308849eb6401fd908a4d063046f163dc11;hpb=cdb96276c1f4a1b3484ac4a1729fa5c9cdff38a5;p=github%2Fshaarli%2FShaarli.git
diff --git a/application/feed/FeedBuilder.php b/application/feed/FeedBuilder.php
index f6def630..ed62af26 100644
--- a/application/feed/FeedBuilder.php
+++ b/application/feed/FeedBuilder.php
@@ -1,4 +1,5 @@
linkDB->search($userInput, null, false, false, true);
+ $linksToDisplay = $this->linkDB->search($userInput ?? [], null, false, false, true);
$nblinksToDisplay = $this->getNbLinks(count($linksToDisplay), $userInput);
// Can't use array_keys() because $link is a LinkDB instance and not a real array.
- $keys = array();
+ $keys = [];
foreach ($linksToDisplay as $key => $value) {
$keys[] = $key;
}
$pageaddr = escape(index_url($this->serverInfo));
$this->formatter->addContextData('index_url', $pageaddr);
- $linkDisplayed = array();
+ $linkDisplayed = [];
for ($i = 0; $i < $nblinksToDisplay && $i < count($keys); $i++) {
$linkDisplayed[$keys[$i]] = $this->buildItem($feedType, $linksToDisplay[$keys[$i]], $pageaddr);
}
@@ -176,9 +177,9 @@ class FeedBuilder
$data = $this->formatter->format($link);
$data['guid'] = rtrim($pageaddr, '/') . '/shaare/' . $data['shorturl'];
if ($this->usePermalinks === true) {
- $permalink = ''. t('Direct link') .'';
+ $permalink = '' . t('Direct link') . '';
} else {
- $permalink = ''. t('Permalink') .'';
+ $permalink = '' . t('Permalink') . '';
}
$data['description'] .= PHP_EOL . PHP_EOL . '
— ' . $permalink;