diff options
author | Arthur <arthur@hoa.ro> | 2015-07-12 11:01:24 +0200 |
---|---|---|
committer | Arthur <arthur@hoa.ro> | 2015-07-12 11:01:24 +0200 |
commit | 7bd3542b1b030070fa3412a2769f9632bd4e6d1b (patch) | |
tree | e2b0bfffec3063025e1872025c805626f3027dc5 /index.php | |
parent | bba021defce15184c986d5e3db138bdbdd4df5d5 (diff) | |
parent | 781e8aadea7590dc87b61915b6e65ec52f7d250e (diff) | |
download | Shaarli-7bd3542b1b030070fa3412a2769f9632bd4e6d1b.tar.gz Shaarli-7bd3542b1b030070fa3412a2769f9632bd4e6d1b.tar.zst Shaarli-7bd3542b1b030070fa3412a2769f9632bd4e6d1b.zip |
Merge pull request #262 from ArthurHoaro/dup-tags
Avoid tag duplicates
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1380,6 +1380,7 @@ function renderPage() | |||
1380 | { | 1380 | { |
1381 | if (!tokenOk($_POST['token'])) die('Wrong token.'); // Go away! | 1381 | if (!tokenOk($_POST['token'])) die('Wrong token.'); // Go away! |
1382 | $tags = trim(preg_replace('/\s\s+/',' ', $_POST['lf_tags'])); // Remove multiple spaces. | 1382 | $tags = trim(preg_replace('/\s\s+/',' ', $_POST['lf_tags'])); // Remove multiple spaces. |
1383 | $tags = implode(' ', array_unique(explode(' ', $tags))); // Remove duplicates. | ||
1383 | $linkdate=$_POST['lf_linkdate']; | 1384 | $linkdate=$_POST['lf_linkdate']; |
1384 | $url = trim($_POST['lf_url']); | 1385 | $url = trim($_POST['lf_url']); |
1385 | if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?') && !startsWith($url,'javascript:')) | 1386 | if (!startsWith($url,'http:') && !startsWith($url,'https:') && !startsWith($url,'ftp:') && !startsWith($url,'magnet:') && !startsWith($url,'?') && !startsWith($url,'javascript:')) |