diff options
author | Mario Vavti <mario@mariovavti.com> | 2017-09-07 23:12:58 +0200 |
---|---|---|
committer | Mario Vavti <mario@mariovavti.com> | 2017-09-07 23:12:58 +0200 |
commit | 4d1f5c175283246f0fbf7c7c8a7312e66efded17 (patch) | |
tree | a0c026cdafe4a9d7c16398f2d94d618bec46245b | |
parent | 4190a40de8c3cf0c08c2b4e559231e72c1faa1cd (diff) | |
download | volse-hubzilla-4d1f5c175283246f0fbf7c7c8a7312e66efded17.tar.gz volse-hubzilla-4d1f5c175283246f0fbf7c7c8a7312e66efded17.tar.bz2 volse-hubzilla-4d1f5c175283246f0fbf7c7c8a7312e66efded17.zip |
do not double encode already encoded mids
-rw-r--r-- | view/js/main.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/view/js/main.js b/view/js/main.js index ce7a1a07e..cdba8a25d 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -699,9 +699,11 @@ function updateConvItems(mode,data) { // auto-scroll to a particular comment in a thread (designated by mid) when in single-thread mode // use the same method to generate the submid as we use in ThreadItem, // base64_encode + replace(['+','='],['','']); - var submid = bParam_mid; - var submid_encoded = ((submid.length) ? submid : 'abcdefg'); - submid_encoded = window.btoa(submid_encoded); + + var submid = ((bParam_mid.length) ? bParam_mid : 'abcdefg'); + var encoded = ((submid.substr(0,4) == 'b64.') ? true : false); + var submid_encoded = ((encoded) ? submid.substr(4) : window.btoa(submid)); + submid_encoded = submid_encoded.replace(/[\+\=]/g,''); if($('.item_' + submid_encoded).length && !$('.item_' + submid_encoded).hasClass('toplevel_item') && mode == 'replace') { if($('.collapsed-comments').length) { |