]> git.mxchange.org Git - friendica.git/commitdiff
bug #37, ampersand + everything following in url is stripped when using link icon...
authorFriendika <info@friendika.com>
Sun, 10 Apr 2011 10:36:12 +0000 (03:36 -0700)
committerFriendika <info@friendika.com>
Sun, 10 Apr 2011 10:36:12 +0000 (03:36 -0700)
include/main.js
mod/parse_url.php
mod/share.php
view/jot-header.tpl

index 18e884b3171253aba9733f77b2b3403a28753afb..8779f84134325cc568bc612fad3085183e487f2f 100644 (file)
          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<f; i++) {  
+            a[i] = s.charCodeAt(i).toString(16).replace(/^([\da-f])$/,"0$1");  
+        }  
+          
+        return a.join('');  
+    }  
\ No newline at end of file
index b3b42b6cb6f2ced24b4da9be57d3d16222116c9e..a65215ca1984aae045beaddf26499f260fd7d616 100644 (file)
@@ -5,7 +5,11 @@ require_once('library/HTML5/Parser.php');
 
 function parse_url_content(&$a) {
 
-       $url = trim($_GET['url']);
+       logger('parse_url: ' . $_GET['url']);
+
+       $url = trim(hex2bin($_GET['url']));
+
+       logger('parse_url: ' . $url);
 
        $text = null;
 
index 94cd035b41a3aba610f7440b86859bf8f482e287..f355a842a7cb360e6bf499f662723998d11f9c6c 100644 (file)
@@ -20,4 +20,4 @@ function share_init(&$a) {
        $o .= bbcode($r[0]['body'], true);
        echo $o . '<br />';
        killme();  
-}
\ No newline at end of file
+}
index eebaf803ac91a4cf021c4c9c87cfa57a158ebeb6..94f0f58f844c584fe4637f0c4b2b41fdec53eaa9 100644 (file)
@@ -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);