X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2Ffeed%2FFeedBuilder.php;h=f6def6308849eb6401fd908a4d063046f163dc11;hb=99ab4f148ba6711883c44425a149a623eff6295f;hp=c97ae1ea0e67ef83682379d8d3885b00ed3d79f6;hpb=7b2ba6ef820335df682fbe3dcfaceef3a62cf4a5;p=github%2Fshaarli%2FShaarli.git diff --git a/application/feed/FeedBuilder.php b/application/feed/FeedBuilder.php index c97ae1ea..f6def630 100644 --- a/application/feed/FeedBuilder.php +++ b/application/feed/FeedBuilder.php @@ -102,7 +102,7 @@ class FeedBuilder } // Optionally filter the results: - $linksToDisplay = $this->linkDB->search($userInput); + $linksToDisplay = $this->linkDB->search($userInput, null, false, false, true); $nblinksToDisplay = $this->getNbLinks(count($linksToDisplay), $userInput); @@ -122,9 +122,9 @@ class FeedBuilder $data['language'] = $this->getTypeLanguage($feedType); $data['last_update'] = $this->getLatestDateFormatted($feedType); $data['show_dates'] = !$this->hideDates || $this->isLoggedIn; - // Remove leading slash from REQUEST_URI. - $data['self_link'] = escape(server_url($this->serverInfo)) - . escape($this->serverInfo['REQUEST_URI']); + // Remove leading path from REQUEST_URI (already contained in $pageaddr). + $requestUri = preg_replace('#(.*?/)(feed.*)#', '$2', escape($this->serverInfo['REQUEST_URI'])); + $data['self_link'] = $pageaddr . $requestUri; $data['index_url'] = $pageaddr; $data['usepermalinks'] = $this->usePermalinks === true; $data['links'] = $linkDisplayed; @@ -174,7 +174,7 @@ class FeedBuilder protected function buildItem(string $feedType, $link, $pageaddr) { $data = $this->formatter->format($link); - $data['guid'] = $pageaddr . '?' . $data['shorturl']; + $data['guid'] = rtrim($pageaddr, '/') . '/shaare/' . $data['shorturl']; if ($this->usePermalinks === true) { $permalink = ''. t('Direct link') .''; } else {