Fix hashtags links in Feeds

Make the hashtag link absolute in feeds to work properly in RSS syndication tools.
This commit is contained in:
ArthurHoaro 2016-10-19 11:05:20 +02:00
parent ceeb8fbeb8
commit fbc28ff1c8
3 changed files with 4 additions and 1 deletions

View file

@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Plugins:
- Tools: only display parameter description when it exists
- archive.org: do not propose archival of private notes
- Use absolute URL for hashtags in RSS and ATOM feeds
### Security
- Allow whitelisting trusted IPs, else continue banning clients upon login failure

View file

@ -153,7 +153,8 @@ class FeedBuilder
} else {
$permalink = '<a href="'. $link['guid'] .'" title="Permalink">Permalink</a>';
}
$link['description'] = format_description($link['description']) . PHP_EOL .'<br>&#8212; '. $permalink;
$link['description'] = format_description($link['description'], '', $pageaddr);
$link['description'] .= PHP_EOL .'<br>&#8212; '. $permalink;
$pubDate = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $link['linkdate']);
$link['pub_iso_date'] = $this->getIsoDate($pubDate);

View file

@ -249,5 +249,6 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase
$link = array_shift($data['links']);
$this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['guid']);
$this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['url']);
$this->assertContains('http://host.tld:8080/~user/shaarli/?addtag=hashtag', $link['description']);
}
}