Display notes as absolute urls.

The deletion is related to Windows not handling quotes in filenames, see
 #179. It shouldn't delete the real file. Probably. Check it out.
This commit is contained in:
feula 2015-03-29 17:31:34 +02:00
parent 129ff3c2e5
commit 3ea318dad0
2 changed files with 17 additions and 10 deletions

View file

@ -1,3 +0,0 @@
This page lists the publications (physical or on the Internet) that mention Shaarli. It is by no means a complete list, and you are invited to add to it, should you spot a Shaarli mentioned in the wild.
* http://www.linuxjournal.com/content/youre-boss-ubos

View file

@ -1940,15 +1940,25 @@ function buildLinkList($PAGE,$LINKSDB)
while ($i<$end && $i<count($keys)) while ($i<$end && $i<count($keys))
{ {
$link = $linksToDisplay[$keys[$i]]; $link = $linksToDisplay[$keys[$i]];
$link['description']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
$title = $link['title']; $title = $link['title'];
$classLi = $i%2!=0 ? '' : 'publicLinkHightLight';
$link['class'] = ($link['private']==0 ? $classLi : 'private');
$link['localdate']=linkdate2locale($link['linkdate']);
$taglist = explode(' ',$link['tags']); $taglist = explode(' ',$link['tags']);
uasort($taglist, 'strcasecmp'); uasort($taglist, 'strcasecmp');
$classLi = $i%2!=0 ? '' : 'publicLinkHightLight'; // This could really be done with just a css pseudoclass.
$link['description'] = nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
$link['class'] = ($link['private']==0 ? $classLi : 'private');
$link['localdate'] = linkdate2locale($link['linkdate']);
$link['taglist'] = $taglist; $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; $linkDisp[$keys[$i]] = $link;
$i++; $i++;
} }