]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Display notes as absolute urls
authorpikzen <mr.pikzen@gmail.com>
Tue, 31 Mar 2015 18:14:49 +0000 (20:14 +0200)
committernodiscc <nodiscc@gmail.com>
Tue, 31 Mar 2015 18:16:06 +0000 (20:16 +0200)
Fixes https://github.com/shaarli/Shaarli/issues/177
Merge commit '3ea318dad05954e2043d5bb2f8572b103d7c3930' into notes-absolute-url
Conflicts:
index.php

1  2 
index.php

diff --cc index.php
index 7795a5974388e20b8a7f11b10ae5691950748fb7,eb7fd10328921323d6015b6f299e57b72ed4379a..83c507bbd64581800c664d6ff62eaa8271233651
+++ b/index.php
@@@ -1935,15 -1940,25 +1940,22 @@@ function buildLinkList($PAGE,$LINKSDB
      while ($i<$end && $i<count($keys))
      {
          $link = $linksToDisplay[$keys[$i]];
 -
+         $title               = $link['title'];
+         $taglist             = explode(' ',$link['tags']);
+         uasort($taglist, 'strcasecmp');
 -
 -        $link['description'] = nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
 -        $link['class']       = ($link['private']==0 ? $classLi : 'private');
 -        $link['localdate']   = linkdate2locale($link['linkdate']);
 -        $link['taglist']     = $taglist;
+         $classLi             = $i%2!=0 ? '' : 'publicLinkHightLight'; // This could really be done with just a css pseudoclass.
-         $title=$link['title'];
-         $classLi =  $i%2!=0 ? '' : 'publicLinkHightLight';
 +        $link['description']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
-         $taglist = explode(' ',$link['tags']);
-         uasort($taglist, 'strcasecmp');
 +        $link['class'] = ($link['private']==0 ? $classLi : 'private');
 +        $link['timestamp']=linkdate2timestamp($link['linkdate']);
 +        $link['taglist']=$taglist;
+         // Convert notes to absolute URLs
+         if ($link["url"][0]      === '?' && // Check for both signs of a note: starting with ? and 7 chars long. I doubt that you'll post any links that look like this.
+             strlen($link["url"]) === 7) {
+             $link["url"] = indexUrl() . $link["url"];
+         }
          $linkDisp[$keys[$i]] = $link;
 -
          $i++;
      }