From 58508201a5fe1f4c3bd6bb93e626c46739afda46 Mon Sep 17 00:00:00 2001 From: Friendika Date: Sun, 10 Apr 2011 03:36:12 -0700 Subject: [PATCH] bug #37, ampersand + everything following in url is stripped when using link icon to share link --- include/main.js | 23 +++++++++++++++++++++++ mod/parse_url.php | 6 +++++- mod/share.php | 2 +- view/jot-header.tpl | 1 + 4 files changed, 30 insertions(+), 2 deletions(-) diff --git a/include/main.js b/include/main.js index 18e884b31..8779f8413 100644 --- a/include/main.js +++ b/include/main.js @@ -255,3 +255,26 @@ return false; } + + function bin2hex(s){ + // Converts the binary representation of data to hex + // + // version: 812.316 + // discuss at: http://phpjs.org/functions/bin2hex + // + original by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) + // + bugfixed by: Onno Marsman + // + bugfixed by: Linuxworld + // * example 1: bin2hex('Kev'); + // * returns 1: '4b6576' + // * example 2: bin2hex(String.fromCharCode(0x00)); + // * returns 2: '00' + var v,i, f = 0, a = []; + s += ''; + f = s.length; + + for (i = 0; i'; killme(); -} \ No newline at end of file +} diff --git a/view/jot-header.tpl b/view/jot-header.tpl index eebaf803a..94f0f58f8 100644 --- a/view/jot-header.tpl +++ b/view/jot-header.tpl @@ -89,6 +89,7 @@ tinyMCE.init({ function jotGetLink() { reply = prompt("$linkurl"); if(reply && reply.length) { + reply = bin2hex(reply); $('#profile-rotator').show(); $.get('parse_url?url=' + reply, function(data) { tinyMCE.execCommand('mceInsertRawHTML',false,data);