Merge branch 'master' of https://github.com/friendica/friendica
This commit is contained in:
commit
30f3a16874
|
@ -174,6 +174,7 @@ function localize_item(&$item){
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -901,24 +901,30 @@ function prepare_body($item,$attach = false) {
|
||||||
foreach($arr as $r) {
|
foreach($arr as $r) {
|
||||||
$matches = false;
|
$matches = false;
|
||||||
$icon = '';
|
$icon = '';
|
||||||
$cnt = preg_match('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches);
|
$cnt = preg_match_all('|\[attach\]href=\"(.*?)\" length=\"(.*?)\" type=\"(.*?)\" title=\"(.*?)\"\[\/attach\]|',$r,$matches, PREG_SET_ORDER);
|
||||||
if($cnt) {
|
if($cnt) {
|
||||||
$icontype = strtolower(substr($matches[3],0,strpos($matches[3],'/')));
|
foreach($matches as $mtch) {
|
||||||
switch($icontype) {
|
$icontype = strtolower(substr($mtch[3],0,strpos($mtch[3],'/')));
|
||||||
case 'video':
|
switch($icontype) {
|
||||||
case 'audio':
|
case 'video':
|
||||||
case 'image':
|
case 'audio':
|
||||||
case 'text':
|
case 'image':
|
||||||
$icon = '<div class="attachtype icon s22 type-' . $icontype . '"></div>';
|
case 'text':
|
||||||
break;
|
$icon = '<div class="attachtype icon s22 type-' . $icontype . '"></div>';
|
||||||
default:
|
break;
|
||||||
$icon = '<div class="attachtype icon s22 type-unkn"></div>';
|
default:
|
||||||
break;
|
$icon = '<div class="attachtype icon s22 type-unkn"></div>';
|
||||||
}
|
break;
|
||||||
$title = ((strlen(trim($matches[4]))) ? escape_tags(trim($matches[4])) : escape_tags($matches[1]));
|
}
|
||||||
$title .= ' ' . $matches[2] . ' ' . t('bytes');
|
$title = ((strlen(trim($mtch[4]))) ? escape_tags(trim($mtch[4])) : escape_tags($mtch[1]));
|
||||||
|
$title .= ' ' . $mtch[2] . ' ' . t('bytes');
|
||||||
|
if((local_user() == $item['uid']) && $item['contact-id'] != $a->contact['id'])
|
||||||
|
$the_url = $a->get_baseurl() . '/redir/' . $item['contact-id'] . '?f=1&url=' . $mtch[1];
|
||||||
|
else
|
||||||
|
$the_url = $mtch[1];
|
||||||
|
|
||||||
$s .= '<a href="' . strip_tags($matches[1]) . '" title="' . $title . '" class="attachlink" target="external-link" >' . $icon . '</a>';
|
$s .= '<a href="' . strip_tags($the_url) . '" title="' . $title . '" class="attachlink" target="external-link" >' . $icon . '</a>';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$s .= '<div class="clear"></div></div>';
|
$s .= '<div class="clear"></div></div>';
|
||||||
|
|
16
mod/item.php
16
mod/item.php
|
@ -290,18 +290,16 @@ function item_post(&$a) {
|
||||||
$author = null;
|
$author = null;
|
||||||
$self = false;
|
$self = false;
|
||||||
|
|
||||||
if(($_SESSION['uid']) && ($_SESSION['uid'] == $profile_uid)) {
|
if((local_user()) && (local_user() == $profile_uid)) {
|
||||||
$self = true;
|
$self = true;
|
||||||
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
|
$r = q("SELECT * FROM `contact` WHERE `uid` = %d AND `self` = 1 LIMIT 1",
|
||||||
intval($_SESSION['uid'])
|
intval($_SESSION['uid'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
else {
|
elseif(remote_user()) {
|
||||||
if((x($_SESSION,'visitor_id')) && (intval($_SESSION['visitor_id']))) {
|
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
||||||
$r = q("SELECT * FROM `contact` WHERE `id` = %d LIMIT 1",
|
intval(remote_user())
|
||||||
intval($_SESSION['visitor_id'])
|
);
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(count($r)) {
|
if(count($r)) {
|
||||||
|
@ -311,7 +309,7 @@ function item_post(&$a) {
|
||||||
|
|
||||||
// get contact info for owner
|
// get contact info for owner
|
||||||
|
|
||||||
if($profile_uid == $_SESSION['uid']) {
|
if($profile_uid == local_user()) {
|
||||||
$contact_record = $author;
|
$contact_record = $author;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -322,8 +320,6 @@ function item_post(&$a) {
|
||||||
$contact_record = $r[0];
|
$contact_record = $r[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$post_type = notags(trim($_REQUEST['type']));
|
$post_type = notags(trim($_REQUEST['type']));
|
||||||
|
|
||||||
if($post_type === 'net-comment') {
|
if($post_type === 'net-comment') {
|
||||||
|
|
|
@ -6,7 +6,7 @@ function redir_init(&$a) {
|
||||||
|
|
||||||
// traditional DFRN
|
// traditional DFRN
|
||||||
|
|
||||||
if(local_user() && $a->argc == 2 && intval($a->argv[1])) {
|
if(local_user() && $a->argc > 1 && intval($a->argv[1])) {
|
||||||
|
|
||||||
$cid = $a->argv[1];
|
$cid = $a->argv[1];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user