Browse Source

The GUID in the link to the items has to be encoded, since it could contain special characters

pull/1069/head
Michael Vogel 6 years ago
parent
commit
b99737986d
3 changed files with 12 additions and 22 deletions
  1. +2
    -3
      include/diaspora.php
  2. +6
    -11
      include/items.php
  3. +4
    -8
      mod/item.php

+ 2
- 3
include/diaspora.php View File

@ -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';


+ 6
- 11
include/items.php View 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']))


+ 4
- 8
mod/item.php View 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);


Loading…
Cancel
Save