X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FFeedBuilder.php;h=ebae18b41c27ac011ff0cb12f8ad69fc6728d13e;hb=033276a8cf809305c320c3b009ab71e4b4ac356a;hp=c6657fbb483215074a4bd5ce5cb57adf6a4276ff;hpb=8406a4b670957b7d0450f6ea5e4f2e61c7114e8f;p=github%2Fshaarli%2FShaarli.git
diff --git a/application/FeedBuilder.php b/application/FeedBuilder.php
index c6657fbb..ebae18b4 100644
--- a/application/FeedBuilder.php
+++ b/application/FeedBuilder.php
@@ -62,11 +62,6 @@ class FeedBuilder
*/
protected $hideDates;
- /**
- * @var string PubSub hub URL.
- */
- protected $pubsubhubUrl;
-
/**
* @var string server locale.
*/
@@ -102,6 +97,11 @@ class FeedBuilder
*/
public function buildData()
{
+ // Search for untagged links
+ if (isset($this->userInput['searchtags']) && empty($this->userInput['searchtags'])) {
+ $this->userInput['searchtags'] = false;
+ }
+
// Optionally filter the results:
$linksToDisplay = $this->linkDB->filterSearch($this->userInput);
@@ -120,7 +120,6 @@ class FeedBuilder
}
$data['language'] = $this->getTypeLanguage();
- $data['pubsubhub_url'] = $this->pubsubhubUrl;
$data['last_update'] = $this->getLatestDateFormatted();
$data['show_dates'] = !$this->hideDates || $this->isLoggedIn;
// Remove leading slash from REQUEST_URI.
@@ -143,24 +142,25 @@ class FeedBuilder
*/
protected function buildItem($link, $pageaddr)
{
- $link['guid'] = $pageaddr .'?'. smallHash($link['linkdate']);
+ $link['guid'] = $pageaddr .'?'. $link['shorturl'];
// Check for both signs of a note: starting with ? and 7 chars long.
if ($link['url'][0] === '?' && strlen($link['url']) === 7) {
$link['url'] = $pageaddr . $link['url'];
}
if ($this->usePermalinks === true) {
- $permalink = 'Direct link';
+ $permalink = ''. t('Direct link') .'';
} else {
- $permalink = 'Permalink';
+ $permalink = ''. t('Permalink') .'';
}
- $link['description'] = format_description($link['description']) . PHP_EOL .'
— '. $permalink;
+ $link['description'] = format_description($link['description'], '', false, $pageaddr);
+ $link['description'] .= PHP_EOL .'
— '. $permalink;
- $pubDate = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $link['linkdate']);
+ $pubDate = $link['created'];
$link['pub_iso_date'] = $this->getIsoDate($pubDate);
// atom:entry elements MUST contain exactly one atom:updated element.
if (!empty($link['updated'])) {
- $upDate = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $link['updated']);
+ $upDate = $link['updated'];
$link['up_iso_date'] = $this->getIsoDate($upDate, DateTime::ATOM);
} else {
$link['up_iso_date'] = $this->getIsoDate($pubDate, DateTime::ATOM);;
@@ -181,16 +181,6 @@ class FeedBuilder
return $link;
}
- /**
- * Assign PubSub hub URL.
- *
- * @param string $pubsubhubUrl PubSub hub url.
- */
- public function setPubsubhubUrl($pubsubhubUrl)
- {
- $this->pubsubhubUrl = $pubsubhubUrl;
- }
-
/**
* Set this to true to use permalinks instead of direct links.
*