]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Fix hashtags links in Feeds 665/head
authorArthurHoaro <arthur@hoa.ro>
Wed, 19 Oct 2016 09:05:20 +0000 (11:05 +0200)
committerArthurHoaro <arthur@hoa.ro>
Thu, 20 Oct 2016 09:42:01 +0000 (11:42 +0200)
Make the hashtag link absolute in feeds to work properly in RSS syndication tools.

CHANGELOG.md
application/FeedBuilder.php
tests/FeedBuilderTest.php

index 60af7223cf35ede5d055d585ae680a3cfcfb3703..72914076b73d669a922a3f0877e91904b0c3c3f5 100644 (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
index c6657fbb483215074a4bd5ce5cb57adf6a4276ff..4036a7cccdf3e77fc1a026adc5ddff93c9845fde 100644 (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);
index aa57f44e7c30c5b0dce249aeabb1bcdcdbe78b3d..d783940273c83f07e4e79a23f3f63d4d5fc5d9e4 100644 (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']);
     }
 }