From: VirtualTam Date: Thu, 20 Oct 2016 19:37:28 +0000 (+0200) Subject: Merge pull request #665 from ArthurHoaro/fix/feed-hashtags X-Git-Tag: v0.8.1~18 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=954dc2446caade6ccad3ffd1173ef139c1f36ad3;hp=fb6c8f770a07e38d5250ca4d6717445002e7bfb3;p=github%2Fshaarli%2FShaarli.git Merge pull request #665 from ArthurHoaro/fix/feed-hashtags Fix hashtag links in Feeds --- diff --git a/CHANGELOG.md b/CHANGELOG.md index e32ef459..d42d6a75 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,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 diff --git a/application/FeedBuilder.php b/application/FeedBuilder.php index c6657fbb..4036a7cc 100644 --- a/application/FeedBuilder.php +++ b/application/FeedBuilder.php @@ -153,7 +153,8 @@ class FeedBuilder } else { $permalink = 'Permalink'; } - $link['description'] = format_description($link['description']) . PHP_EOL .'
— '. $permalink; + $link['description'] = format_description($link['description'], '', $pageaddr); + $link['description'] .= PHP_EOL .'
— '. $permalink; $pubDate = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $link['linkdate']); $link['pub_iso_date'] = $this->getIsoDate($pubDate); diff --git a/tests/FeedBuilderTest.php b/tests/FeedBuilderTest.php index aa57f44e..d7839402 100644 --- a/tests/FeedBuilderTest.php +++ b/tests/FeedBuilderTest.php @@ -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']); } }