]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Merge pull request #582 from ArthurHoaro/hotfix/nomarkdown
authorArthur <arthur@hoa.ro>
Mon, 6 Jun 2016 17:52:32 +0000 (19:52 +0200)
committerArthur <arthur@hoa.ro>
Mon, 6 Jun 2016 17:52:32 +0000 (19:52 +0200)
The "nomarkdown" tag is no longer private

README.md
application/LinkDB.php
application/Url.php
tests/FeedBuilderTest.php
tests/LinkDBTest.php
tests/Url/UrlTest.php
tests/utils/ReferenceLinkDB.php

index d67c10acbd63f7c0fc385f5792829db14d88a49e..d8328d83b5b310bd1ebe25c6c05b269430c16cb7 100644 (file)
--- 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)
index 1cb70de02344b07aad4b1ca79f21fb1a95f6ed73..b1072e0770a3dcd8b0ae847ba3be9e8bd2011b29 100644 (file)
@@ -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)
index 77447c8df96635c17f55a90cb463a1313c35170a..c166ff6ef03f6023c2bf895279f8eb8940736ba9 100644 (file)
@@ -99,6 +99,7 @@ class Url
         'action_type_map=',
         'fb_',
         'fb=',
+        'PHPSESSID=',
 
         // Scoop.it
         '__scoop',
index 069b158154f4a3b7eafa516556d2e56bb3d1baec..647b2db24b3619a9afb95e10a7435b6501ae43fb 100644 (file)
@@ -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']);
index b055fe9169e2a57377c3ed08ef9b27a9af546ae0..30ea4e01a3fff40b177ca001ec2d140850488466 100644 (file)
@@ -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,
             ),
index ce82265e305bfceec3b69e232002a411f5ea0d67..4bf53b2dfc675da911c6e3fb3df469cfbd2cec5a 100644 (file)
@@ -85,6 +85,7 @@ class UrlTest extends PHPUnit_Framework_TestCase
         $this->assertUrlIsCleaned('?utm_term=1n4l');
 
         $this->assertUrlIsCleaned('?xtor=some-url');
+        $this->assertUrlIsCleaned('?PHPSESSID=012345678910111213');
     }
 
     /**
index dc4f5dfa98ccb7e1fbd28decd67417ca93d46dfa..46165b4d55f36f1ec02f3cb9ad4aa5a68fd6ff99 100644 (file)
@@ -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(