aboutsummaryrefslogtreecommitdiffhomepage
path: root/index.php
diff options
context:
space:
mode:
authorfeula <mr.pikzen@gmail.com>2015-03-29 17:31:34 +0200
committerfeula <mr.pikzen@gmail.com>2015-03-29 17:31:38 +0200
commit3ea318dad05954e2043d5bb2f8572b103d7c3930 (patch)
tree26738100dc0f9fd7e8edadd0e0a7e132ad26e1ec /index.php
parent129ff3c2e50154d563de12c85ec7597df5bded5a (diff)
downloadShaarli-3ea318dad05954e2043d5bb2f8572b103d7c3930.tar.gz
Shaarli-3ea318dad05954e2043d5bb2f8572b103d7c3930.tar.zst
Shaarli-3ea318dad05954e2043d5bb2f8572b103d7c3930.zip
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.
Diffstat (limited to 'index.php')
-rw-r--r--index.php24
1 files changed, 17 insertions, 7 deletions
diff --git a/index.php b/index.php
index 0d3c3301..eb7fd103 100644
--- a/index.php
+++ b/index.php
@@ -1940,15 +1940,25 @@ function buildLinkList($PAGE,$LINKSDB)
1940 while ($i<$end && $i<count($keys)) 1940 while ($i<$end && $i<count($keys))
1941 { 1941 {
1942 $link = $linksToDisplay[$keys[$i]]; 1942 $link = $linksToDisplay[$keys[$i]];
1943 $link['description']=nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description'])))); 1943 $title = $link['title'];
1944 $title=$link['title']; 1944 $taglist = explode(' ',$link['tags']);
1945 $classLi = $i%2!=0 ? '' : 'publicLinkHightLight';
1946 $link['class'] = ($link['private']==0 ? $classLi : 'private');
1947 $link['localdate']=linkdate2locale($link['linkdate']);
1948 $taglist = explode(' ',$link['tags']);
1949 uasort($taglist, 'strcasecmp'); 1945 uasort($taglist, 'strcasecmp');
1950 $link['taglist']=$taglist; 1946
1947 $classLi = $i%2!=0 ? '' : 'publicLinkHightLight'; // This could really be done with just a css pseudoclass.
1948
1949 $link['description'] = nl2br(keepMultipleSpaces(text2clickable(htmlspecialchars($link['description']))));
1950 $link['class'] = ($link['private']==0 ? $classLi : 'private');
1951 $link['localdate'] = linkdate2locale($link['linkdate']);
1952 $link['taglist'] = $taglist;
1953
1954 // Convert notes to absolute URLs
1955 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.
1956 strlen($link["url"]) === 7) {
1957 $link["url"] = indexUrl() . $link["url"];
1958 }
1959
1951 $linkDisp[$keys[$i]] = $link; 1960 $linkDisp[$keys[$i]] = $link;
1961
1952 $i++; 1962 $i++;
1953 } 1963 }
1954 1964