fix url mismatches of a single trailing slash for feed author/owner comparisons; update diaspora_compat

This commit is contained in:
friendica
2014-09-23 20:55:22 -07:00
parent 02210b81d8
commit 81ee35e03b
4 changed files with 10 additions and 15 deletions

View File

@@ -131,10 +131,8 @@ function diaspora2bb($s,$use_zrl = false) {
// $s = preg_replace('/\@\{(.+?)\; (.+?)\@(.+?)\}/','@[url=https://$3/u/$2]$1[/url]',$s);
// first try plustags
// nope don't do it. This will cause mis-attributed messages and runaway delivery chains -
// Diaspora doesn't have sufficient delivery loop detection.
// Leave the next line commented and leave this description here so future readers will know why.
// $s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_mention_callback',$s);
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}\+/','diaspora_mention_callback',$s);
$s = preg_replace_callback('/\@\{(.+?)\; (.+?)\@(.+?)\}/','diaspora_mention_callback',$s);

View File

@@ -19,6 +19,9 @@ function new_contact($uid,$url,$channel,$interactive = false, $confirm = false)
$is_red = false;
$is_http = ((strpos($url,'://') !== false) ? true : false);
if($is_http && substr($url,-1,1) === '/')
$url = substr($url,0,-1);
if(! allowed_url($url)) {
$result['message'] = t('Channel is blocked on this site.');
return $result;

View File

@@ -1424,6 +1424,9 @@ function get_atom_elements($feed,$item,&$author) {
$author['author_link'] = unxmlify($feed->get_permalink());
}
if(substr($author['author_link'],-1,1) == '/')
$author['author_link'] = substr($author['author_link'],0,-1);
$res['mid'] = base64url_encode(unxmlify($item->get_id()));
$res['title'] = unxmlify($item->get_title());
$res['body'] = unxmlify($item->get_content());