]> git.mxchange.org Git - friendica.git/commitdiff
The GUID in the link to the items has to be encoded, since it could contain special...
authorMichael Vogel <icarus@dabo.de>
Sat, 9 Aug 2014 07:17:28 +0000 (09:17 +0200)
committerMichael Vogel <icarus@dabo.de>
Sat, 9 Aug 2014 07:17:28 +0000 (09:17 +0200)
include/diaspora.php
include/items.php
mod/item.php

index 0eeacc487989660a7bdbd272083bc2ee398a75ce..8b85e7b9552c2158b71a81b2d56c8cca5955e427 100755 (executable)
@@ -1423,8 +1423,7 @@ function diaspora_comment($importer,$xml,$msg) {
                                'to_email'     => $importer['email'],
                                'uid'          => $importer['uid'],
                                'item'         => $datarray,
-                               //'link'                   => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $message_id,
-                               'link'             => $a->get_baseurl().'/display/'.$datarray['guid'],
+                               'link'             => $a->get_baseurl().'/display/'.urlencode($datarray['guid']),
                                'source_name'  => $datarray['author-name'],
                                'source_link'  => $datarray['author-link'],
                                'source_photo' => $datarray['author-avatar'],
@@ -1960,7 +1959,7 @@ EOT;
        $ulink = '[url=' . $contact['url'] . ']' . $contact['name'] . '[/url]';
        $alink = '[url=' . $parent_item['author-link'] . ']' . $parent_item['author-name'] . '[/url]';
        //$plink = '[url=' . $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $parent_item['id'] . ']' . $post_type . '[/url]';
-       $plink = '[url='.$a->get_baseurl().'/display/'.$guid.']'.$post_type.'[/url]';
+       $plink = '[url='.$a->get_baseurl().'/display/'.urlencode($guid).']'.$post_type.'[/url]';
        $arr['body'] =  sprintf( $bodyverb, $ulink, $alink, $plink );
 
        $arr['app']  = 'Diaspora';
index 6a72320cd1edb72b1e7bed6d13233f17ab0f8ac8..fbbc5e7aede9bee5e3a7a7b54639a250b59466f5 100644 (file)
@@ -1117,7 +1117,7 @@ function item_store($arr,$force_parent = false) {
 
        if ($arr['plink'] == "") {
                $a = get_app();
-               $arr['plink'] = $a->get_baseurl().'/display/'.$arr['guid'];
+               $arr['plink'] = $a->get_baseurl().'/display/'.urlencode($arr['guid']);
        }
 
        if ($arr['network'] == "") {
@@ -1298,8 +1298,7 @@ function item_store($arr,$force_parent = false) {
                                        'to_email'     => $u[0]['email'],
                                        'uid'          => $u[0]['uid'],
                                        'item'         => $item[0],
-                                       //'link'         => $a->get_baseurl().'/display/'.$u[0]['nickname'].'/'.$current_post,
-                                       'link'         => $a->get_baseurl().'/display/'.$arr['guid'],
+                                       'link'         => $a->get_baseurl().'/display/'.urlencode($arr['guid']),
                                        'source_name'  => $item[0]['author-name'],
                                        'source_link'  => $item[0]['author-link'],
                                        'source_photo' => $item[0]['author-avatar'],
@@ -1563,8 +1562,7 @@ function tag_deliver($uid,$item_id) {
                'to_email'     => $u[0]['email'],
                'uid'          => $u[0]['uid'],
                'item'         => $item,
-               //'link'         => $a->get_baseurl() . '/display/' . $u[0]['nickname'] . '/' . $item['id'],
-               'link'         => $a->get_baseurl() . '/display/'.get_item_guid($item['id']),
+               'link'         => $a->get_baseurl() . '/display/'.urlencode(get_item_guid($item['id'])),
                'source_name'  => $item['author-name'],
                'source_link'  => $item['author-link'],
                'source_photo' => $photo,
@@ -3379,8 +3377,7 @@ function local_delivery($importer,$data) {
                                                                'to_email'     => $importer['email'],
                                                                'uid'          => $importer['importer_uid'],
                                                                'item'         => $datarray,
-                                                               //'link'                   => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
-                                                               'link'             => $a->get_baseurl().'/display/'.get_item_guid($posted_id),
+                                                               'link'             => $a->get_baseurl().'/display/'.urlencode(get_item_guid($posted_id)),
                                                                'source_name'  => stripslashes($datarray['author-name']),
                                                                'source_link'  => $datarray['author-link'],
                                                                'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
@@ -3544,8 +3541,7 @@ function local_delivery($importer,$data) {
                                                                        'to_email'     => $importer['email'],
                                                                        'uid'          => $importer['importer_uid'],
                                                                        'item'         => $datarray,
-                                                                       //'link'                   => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
-                                                                       'link'             => $a->get_baseurl().'/display/'.get_item_guid($posted_id),
+                                                                       'link'             => $a->get_baseurl().'/display/'.urlencode(get_item_guid($posted_id)),
                                                                        'source_name'  => stripslashes($datarray['author-name']),
                                                                        'source_link'  => $datarray['author-link'],
                                                                        'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
@@ -3698,8 +3694,7 @@ function local_delivery($importer,$data) {
                                                        'to_email'     => $importer['email'],
                                                        'uid'          => $importer['importer_uid'],
                                                        'item'         => $datarray,
-                                                       //'link'                   => $a->get_baseurl() . '/display/' . $importer['nickname'] . '/' . $posted_id,
-                                                       'link'             => $a->get_baseurl().'/display/'.get_item_guid($posted_id),
+                                                       'link'             => $a->get_baseurl().'/display/'.urlencode(get_item_guid($posted_id)),
                                                        'source_name'  => stripslashes($datarray['author-name']),
                                                        'source_link'  => $datarray['author-link'],
                                                        'source_photo' => ((link_compare($datarray['author-link'],$importer['url']))
index 901fb3385da8cb2779212e7242fb02d4cf668cae..9be9de6688e65dfaa3c506d7266209160d2d2970 100644 (file)
@@ -847,8 +847,7 @@ function item_post(&$a) {
                                        'to_email'     => $user['email'],
                                        'uid'          => $user['uid'],
                                        'item'         => $datarray,
-                                       //'link'                   => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
-                                       'link'             => $a->get_baseurl().'/display/'.$datarray['guid'],
+                                       'link'          => $a->get_baseurl().'/display/'.urlencode($datarray['guid']),
                                        'source_name'  => $datarray['author-name'],
                                        'source_link'  => $datarray['author-link'],
                                        'source_photo' => $datarray['author-avatar'],
@@ -876,8 +875,7 @@ function item_post(&$a) {
                                        'to_email'     => $user['email'],
                                        'uid'          => $user['uid'],
                                        'item'         => $datarray,
-                                       //'link'                   => $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id,
-                                       'link'             => $a->get_baseurl().'/display/'.$datarray['guid'],
+                                       'link'          => $a->get_baseurl().'/display/'.urlencode($datarray['guid']),
                                        'source_name'  => $datarray['author-name'],
                                        'source_link'  => $datarray['author-link'],
                                        'source_photo' => $datarray['author-avatar'],
@@ -896,8 +894,7 @@ function item_post(&$a) {
                        WHERE `id` = %d",
                        intval($parent),
                        dbesc(($parent == $post_id) ? $uri : $parent_item['uri']),
-                       //dbesc($a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id),
-                       dbesc($a->get_baseurl().'/display/'.$datarray['guid']),
+                       dbesc($a->get_baseurl().'/display/'.urlencode($datarray['guid'])),
                        dbesc(datetime_convert()),
                        intval($post_id)
                );
@@ -930,8 +927,7 @@ function item_post(&$a) {
        update_thread($parent);
 
        $datarray['id']    = $post_id;
-       //$datarray['plink'] = $a->get_baseurl() . '/display/' . $user['nickname'] . '/' . $post_id;
-       $datarray['plink'] = $a->get_baseurl().'/display/'.$datarray['guid'];
+       $datarray['plink'] = $a->get_baseurl().'/display/'.urlencode($datarray['guid']);
 
        call_hooks('post_local_end', $datarray);