]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Page title if there is a single link 233/head
authorArthurHoaro <arthur@hoa.ro>
Tue, 23 Jun 2015 18:22:02 +0000 (20:22 +0200)
committerArthurHoaro <arthur@hoa.ro>
Tue, 23 Jun 2015 18:22:02 +0000 (20:22 +0200)
Fixes #232

index.php

index 5aa7116fe087404ff2048a0cc2068c8ac71d7107..db2b7521d359e413580b017d64669e292ce05d87 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1706,8 +1706,10 @@ function buildLinkList($PAGE,$LINKSDB)
     */
     $keys=array(); foreach($linksToDisplay as $key=>$value) { $keys[]=$key; } // Stupid and ugly. Thanks PHP.
 
-    // If there is only a single link, we change on-the-fly the title of the page.
-    if (count($linksToDisplay)==1) $GLOBALS['pagetitle'] = $linksToDisplay[$keys[0]]['title'].' - '.$GLOBALS['title'];
+    // If it's a permalink, we change on-the-fly the title of the page.
+    if(!empty($search_type && $search_type == 'permalink')) {
+        $GLOBALS['pagetitle'] = $linksToDisplay[$keys[0]]['title'] . ' - ' . $GLOBALS['title'];
+    }
 
     // Select articles according to paging.
     $pagecount = ceil(count($keys)/$_SESSION['LINKS_PER_PAGE']);