diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-09-18 13:26:36 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-11-26 20:14:38 +0100 |
commit | 90e5bd65c9d4a5d3d5cedfeaa1314f2a15df5227 (patch) | |
tree | 7a085b9aecaa92aa5076df01df78c39edd2acff5 /tpl | |
parent | 986afb752bc57271e76935da9ed2df6ef8713cb7 (diff) | |
download | Shaarli-90e5bd65c9d4a5d3d5cedfeaa1314f2a15df5227.tar.gz Shaarli-90e5bd65c9d4a5d3d5cedfeaa1314f2a15df5227.tar.zst Shaarli-90e5bd65c9d4a5d3d5cedfeaa1314f2a15df5227.zip |
URL encode links when a redirector is set.
Fixes #328 - URL encode links when a redirector is set
* WARNING - template edit - new variable available : "real_url"
Contains the final real url (redirected or any other change on original URL)
* Don't redirect shaares link in RSS/Atom.
* Affects links shaared in description.
* Move text2clickable and keepMultipleSpaces to Utils.php + unit test
UPDATE:
* keepMultipleSpaces renamed to space2nbsp
* space2nbsp improved to handle single space at line beginning
* links in text description aren't 'nofollow' anymore
Diffstat (limited to 'tpl')
-rw-r--r-- | tpl/daily.html | 2 | ||||
-rw-r--r-- | tpl/linklist.html | 6 | ||||
-rw-r--r-- | tpl/picwall.html | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/tpl/daily.html b/tpl/daily.html index 93a3ab45..063dc89a 100644 --- a/tpl/daily.html +++ b/tpl/daily.html | |||
@@ -66,7 +66,7 @@ | |||
66 | </div> | 66 | </div> |
67 | {/if} | 67 | {/if} |
68 | <div class="dailyEntryTitle"> | 68 | <div class="dailyEntryTitle"> |
69 | <a href="{$link.url}">{$link.title}</a> | 69 | <a href="{$link.real_url}">{$link.title}</a> |
70 | </div> | 70 | </div> |
71 | {if="$link.thumbnail"} | 71 | {if="$link.thumbnail"} |
72 | <div class="dailyEntryThumbnail">{$link.thumbnail}</div> | 72 | <div class="dailyEntryThumbnail">{$link.thumbnail}</div> |
diff --git a/tpl/linklist.html b/tpl/linklist.html index f6e9e82b..666748a7 100644 --- a/tpl/linklist.html +++ b/tpl/linklist.html | |||
@@ -70,7 +70,9 @@ | |||
70 | </form> | 70 | </form> |
71 | </div> | 71 | </div> |
72 | {/if} | 72 | {/if} |
73 | <span class="linktitle"><a href="{$redirector}{$value.url}">{$value.title}</a></span> | 73 | <span class="linktitle"> |
74 | <a href="{$value.real_url}">{$value.title}</a> | ||
75 | </span> | ||
74 | <br> | 76 | <br> |
75 | {if="$value.description"}<div class="linkdescription">{$value.description}</div>{/if} | 77 | {if="$value.description"}<div class="linkdescription">{$value.description}</div>{/if} |
76 | {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} | 78 | {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} |
@@ -83,7 +85,7 @@ | |||
83 | <span>{$value}</span> - | 85 | <span>{$value}</span> - |
84 | {/loop} | 86 | {/loop} |
85 | 87 | ||
86 | <a href="{$value.url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br> | 88 | <a href="{$value.real_url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br> |
87 | {if="$value.tags"} | 89 | {if="$value.tags"} |
88 | <div class="linktaglist"> | 90 | <div class="linktaglist"> |
89 | {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value}</a></span> {/loop} | 91 | {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value}</a></span> {/loop} |
diff --git a/tpl/picwall.html b/tpl/picwall.html index 97d5efdf..230c948b 100644 --- a/tpl/picwall.html +++ b/tpl/picwall.html | |||
@@ -16,7 +16,7 @@ | |||
16 | <div id="picwall_container"> | 16 | <div id="picwall_container"> |
17 | {loop="linksToDisplay"} | 17 | {loop="linksToDisplay"} |
18 | <div class="picwall_pictureframe"> | 18 | <div class="picwall_pictureframe"> |
19 | {$value.thumbnail}<a href="{$value.url}"><span class="info">{$value.title}</span></a> | 19 | {$value.thumbnail}<a href="{$value.real_url}"><span class="info">{$value.title}</span></a> |
20 | {loop="$value.picwall_plugin"} | 20 | {loop="$value.picwall_plugin"} |
21 | {$value} | 21 | {$value} |
22 | {/loop} | 22 | {/loop} |