Skip to content

Node.js based forum software built for the modern web

fixes double hashes in share links

Baris Soner Usaklicd9bd91ab2a4
diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js
index 33b6fbc4a2..8ebd8342d8 100644
--- a/public/src/forum/topic.js
+++ b/public/src/forum/topic.js
@@ -484,7 +484,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
$('#post-container').on('shown.bs.dropdown', '.share-dropdown', function() {
var pid = $(this).parents('.post-row').attr('data-pid');
- $('#post_' + pid + '_link').val(window.location.href + "#" + pid);
+ $('#post_' + pid + '_link').val(window.location.protocol + '//' + window.location.host + window.location.pathname + '#' + pid);
// without the setTimeout can't select the text in the input
setTimeout(function() {
$('#post_' + pid + '_link').putCursorAtEnd().select();