From: Arthur Date: Mon, 6 Jun 2016 17:52:32 +0000 (+0200) Subject: Merge pull request #582 from ArthurHoaro/hotfix/nomarkdown X-Git-Tag: v0.8.0~30 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=bb9ca54838e2f877635197541e8439171c83d5dc;hp=8c4e60186d393a7c42b6bc09e81ba3051092076e;p=github%2Fshaarli%2FShaarli.git Merge pull request #582 from ArthurHoaro/hotfix/nomarkdown The "nomarkdown" tag is no longer private --- diff --git a/README.md b/README.md index d67c10ac..d8328d83 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Login: `demo`; Password: `demo` ### Installation & upgrade - [Download](https://github.com/shaarli/Shaarli/wiki/Download) +- [Upgrade and migration](https://github.com/shaarli/Shaarli/wiki/Upgrade-and-migration) - [Server requirements](https://github.com/shaarli/Shaarli/wiki/Server-requirements) - [Server configuration](https://github.com/shaarli/Shaarli/wiki/Server-configuration) - [Shaarli configuration](https://github.com/shaarli/Shaarli/wiki/Shaarli-configuration) diff --git a/application/LinkDB.php b/application/LinkDB.php index 1cb70de0..b1072e07 100644 --- a/application/LinkDB.php +++ b/application/LinkDB.php @@ -440,11 +440,18 @@ You use the community supported version of the original Shaarli project, by Seba public function allTags() { $tags = array(); + $caseMapping = array(); foreach ($this->_links as $link) { foreach (explode(' ', $link['tags']) as $tag) { - if (!empty($tag)) { - $tags[$tag] = (empty($tags[$tag]) ? 1 : $tags[$tag] + 1); + if (empty($tag)) { + continue; } + // The first case found will be displayed. + if (!isset($caseMapping[strtolower($tag)])) { + $caseMapping[strtolower($tag)] = $tag; + $tags[$caseMapping[strtolower($tag)]] = 0; + } + $tags[$caseMapping[strtolower($tag)]]++; } } // Sort tags by usage (most used tag first) diff --git a/application/Url.php b/application/Url.php index 77447c8d..c166ff6e 100644 --- a/application/Url.php +++ b/application/Url.php @@ -99,6 +99,7 @@ class Url 'action_type_map=', 'fb_', 'fb=', + 'PHPSESSID=', // Scoop.it '__scoop', diff --git a/tests/FeedBuilderTest.php b/tests/FeedBuilderTest.php index 069b1581..647b2db2 100644 --- a/tests/FeedBuilderTest.php +++ b/tests/FeedBuilderTest.php @@ -93,7 +93,7 @@ class FeedBuilderTest extends PHPUnit_Framework_TestCase $this->assertContains('Permalink', $link['description']); $this->assertContains('http://host.tld/?WDWyig', $link['description']); $this->assertEquals(1, count($link['taglist'])); - $this->assertEquals('stuff', $link['taglist'][0]); + $this->assertEquals('sTuff', $link['taglist'][0]); // Test URL with external link. $this->assertEquals('https://static.fsf.org/nosvn/faif-2.0.pdf', $data['links']['20150310_114633']['url']); diff --git a/tests/LinkDBTest.php b/tests/LinkDBTest.php index b055fe91..30ea4e01 100644 --- a/tests/LinkDBTest.php +++ b/tests/LinkDBTest.php @@ -290,7 +290,9 @@ class LinkDBTest extends PHPUnit_Framework_TestCase 'stallman' => 1, 'free' => 1, '-exclude' => 1, - 'stuff' => 2, + // The DB contains a link with `sTuff` and another one with `stuff` tag. + // They need to be grouped with the first case found (`sTuff`). + 'sTuff' => 2, ), self::$publicLinkDB->allTags() ); @@ -310,7 +312,7 @@ class LinkDBTest extends PHPUnit_Framework_TestCase 'w3c' => 1, 'css' => 1, 'Mercurial' => 1, - 'stuff' => 2, + 'sTuff' => 2, '-exclude' => 1, '.hidden' => 1, ), diff --git a/tests/Url/UrlTest.php b/tests/Url/UrlTest.php index ce82265e..4bf53b2d 100644 --- a/tests/Url/UrlTest.php +++ b/tests/Url/UrlTest.php @@ -85,6 +85,7 @@ class UrlTest extends PHPUnit_Framework_TestCase $this->assertUrlIsCleaned('?utm_term=1n4l'); $this->assertUrlIsCleaned('?xtor=some-url'); + $this->assertUrlIsCleaned('?PHPSESSID=012345678910111213'); } /** diff --git a/tests/utils/ReferenceLinkDB.php b/tests/utils/ReferenceLinkDB.php index dc4f5dfa..46165b4d 100644 --- a/tests/utils/ReferenceLinkDB.php +++ b/tests/utils/ReferenceLinkDB.php @@ -21,7 +21,7 @@ class ReferenceLinkDB 'Stallman has a beard and is part of the Free Software Foundation (or not). Seriously, read this.', 0, '20150310_114651', - 'stuff' + 'sTuff' ); $this->addLink(