diff options
author | ArthurHoaro <arthur@hoa.ro> | 2015-06-11 13:53:27 +0200 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2015-06-23 16:35:36 +0200 |
commit | 5f85fcd863fe261921953ea3bd1742f3e1b7cf68 (patch) | |
tree | 5615922c1c696ec04cc60625a8d401b2b297a462 /tpl/linklist.html | |
parent | 0923a2bc1b097bf1def882722db489d83d95c423 (diff) | |
download | Shaarli-5f85fcd863fe261921953ea3bd1742f3e1b7cf68.tar.gz Shaarli-5f85fcd863fe261921953ea3bd1742f3e1b7cf68.tar.zst Shaarli-5f85fcd863fe261921953ea3bd1742f3e1b7cf68.zip |
Working on shaarli/Shaarli#224
I reviewed character escaping everywhere with the following ideas:
* use a single common function to escape user data: `escape` using `htmlspecialchars`.
* sanitize fields in `index.php` after reading them from datastore and before sending them to templates.
It means no escaping function in Twig templates.
2 reasons:
* it reduces risks of security issue for future user made templates
* more readable templates
* sanitize user configuration fields after loading them.
Diffstat (limited to 'tpl/linklist.html')
-rw-r--r-- | tpl/linklist.html | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tpl/linklist.html b/tpl/linklist.html index a59a9e51..daf87060 100644 --- a/tpl/linklist.html +++ b/tpl/linklist.html | |||
@@ -33,7 +33,7 @@ | |||
33 | {if="$search_type=='tags'"} | 33 | {if="$search_type=='tags'"} |
34 | <div id="searchcriteria">{$result_count} results for tags <i> | 34 | <div id="searchcriteria">{$result_count} results for tags <i> |
35 | {loop="search_crits"} | 35 | {loop="search_crits"} |
36 | <span class="linktag" title="Remove tag"><a href="?removetag={$value|htmlspecialchars}">{$value|htmlspecialchars} <span class="remove">x</span></a></span> | 36 | <span class="linktag" title="Remove tag"><a href="?removetag={$value}">{$value} <span class="remove">x</span></a></span> |
37 | {/loop}</i></div> | 37 | {/loop}</i></div> |
38 | {/if} | 38 | {/if} |
39 | {/if} | 39 | {/if} |
@@ -50,7 +50,7 @@ | |||
50 | <input type="hidden" name="token" value="{$token}"><input type="hidden" name="delete_link"><input type="image" alt="Delete" src="images/delete_icon.png#" title="Delete" class="button_delete" onClick="return confirmDeleteLink();"></form> | 50 | <input type="hidden" name="token" value="{$token}"><input type="hidden" name="delete_link"><input type="image" alt="Delete" src="images/delete_icon.png#" title="Delete" class="button_delete" onClick="return confirmDeleteLink();"></form> |
51 | </div> | 51 | </div> |
52 | {/if} | 52 | {/if} |
53 | <span class="linktitle"><a href="{$redirector}{$value.url|htmlspecialchars}">{$value.title|htmlspecialchars}</a></span> | 53 | <span class="linktitle"><a href="{$redirector}{$value.url}">{$value.title}</a></span> |
54 | <br> | 54 | <br> |
55 | {if="$value.description"}<div class="linkdescription">{$value.description}</div>{/if} | 55 | {if="$value.description"}<div class="linkdescription">{$value.description}</div>{/if} |
56 | {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} | 56 | {if="!$GLOBALS['config']['HIDE_TIMESTAMPS'] || isLoggedIn()"} |
@@ -59,15 +59,15 @@ | |||
59 | <span class="linkdate" title="Short link here"><a href="?{$value.linkdate|smallHash}">permalink</a> - </span> | 59 | <span class="linkdate" title="Short link here"><a href="?{$value.linkdate|smallHash}">permalink</a> - </span> |
60 | {/if} | 60 | {/if} |
61 | {if="$GLOBALS['config']['ARCHIVE_ORG']"} | 61 | {if="$GLOBALS['config']['ARCHIVE_ORG']"} |
62 | <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url|htmlspecialchars}">archive</a> - </span> | 62 | <span class="linkarchive"><a href="https://web.archive.org/web/{$value.url}">archive</a> - </span> |
63 | {/if} | 63 | {/if} |
64 | <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}" | 64 | <div class="linkqrcode"><a href="http://qrfree.kaywa.com/?l=1&s=8&d={$scripturl|urlencode}%3F{$value.linkdate|smallHash}" |
65 | onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"> | 65 | onclick="return showQrCode(this);" class="qrcode" data-permalink="{$scripturl}?{$value.linkdate|smallHash}"> |
66 | <img src="images/qrcode.png#" alt="QR-Code" title="{function="strftime('%c', $value.timestamp)"}"></a></div> - | 66 | <img src="images/qrcode.png#" alt="QR-Code" title="{function="strftime('%c', $value.timestamp)"}"></a></div> - |
67 | <a href="{$value.url|htmlspecialchars}"><span class="linkurl" title="Short link">{$value.url|htmlspecialchars}</span></a><br> | 67 | <a href="{$value.url}"><span class="linkurl" title="Short link">{$value.url}</span></a><br> |
68 | {if="$value.tags"} | 68 | {if="$value.tags"} |
69 | <div class="linktaglist"> | 69 | <div class="linktaglist"> |
70 | {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value|htmlspecialchars}</a></span> {/loop} | 70 | {loop="value.taglist"}<span class="linktag" title="Add tag"><a href="?addtag={$value|urlencode}">{$value}</a></span> {/loop} |
71 | </div> | 71 | </div> |
72 | {/if} | 72 | {/if} |
73 | </div> | 73 | </div> |