aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVirtualTam <virtualtam+github@flibidi.net>2016-10-20 21:37:28 +0200
committerGitHub <noreply@github.com>2016-10-20 21:37:28 +0200
commit954dc2446caade6ccad3ffd1173ef139c1f36ad3 (patch)
treeed335a59a71a8561aef8952133e9904d8064125e
parentfb6c8f770a07e38d5250ca4d6717445002e7bfb3 (diff)
parentfbc28ff1c892460e90e87a1be6dd3e28a4cd58b8 (diff)
downloadShaarli-954dc2446caade6ccad3ffd1173ef139c1f36ad3.tar.gz
Shaarli-954dc2446caade6ccad3ffd1173ef139c1f36ad3.tar.zst
Shaarli-954dc2446caade6ccad3ffd1173ef139c1f36ad3.zip
Merge pull request #665 from ArthurHoaro/fix/feed-hashtags
Fix hashtag links in Feeds
-rw-r--r--CHANGELOG.md1
-rw-r--r--application/FeedBuilder.php3
-rw-r--r--tests/FeedBuilderTest.php1
3 files changed, 4 insertions, 1 deletions
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/).
26- Plugins: 26- Plugins:
27 - Tools: only display parameter description when it exists 27 - Tools: only display parameter description when it exists
28 - archive.org: do not propose archival of private notes 28 - archive.org: do not propose archival of private notes
29- Use absolute URL for hashtags in RSS and ATOM feeds
29 30
30### Security 31### Security
31- Allow whitelisting trusted IPs, else continue banning clients upon login failure 32- 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
153 } else { 153 } else {
154 $permalink = '<a href="'. $link['guid'] .'" title="Permalink">Permalink</a>'; 154 $permalink = '<a href="'. $link['guid'] .'" title="Permalink">Permalink</a>';
155 } 155 }
156 $link['description'] = format_description($link['description']) . PHP_EOL .'<br>&#8212; '. $permalink; 156 $link['description'] = format_description($link['description'], '', $pageaddr);
157 $link['description'] .= PHP_EOL .'<br>&#8212; '. $permalink;
157 158
158 $pubDate = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $link['linkdate']); 159 $pubDate = DateTime::createFromFormat(LinkDB::LINK_DATE_FORMAT, $link['linkdate']);
159 $link['pub_iso_date'] = $this->getIsoDate($pubDate); 160 $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
249 $link = array_shift($data['links']); 249 $link = array_shift($data['links']);
250 $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['guid']); 250 $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['guid']);
251 $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['url']); 251 $this->assertEquals('http://host.tld:8080/~user/shaarli/?WDWyig', $link['url']);
252 $this->assertContains('http://host.tld:8080/~user/shaarli/?addtag=hashtag', $link['description']);
252 } 253 }
253} 254}