Merge remote-tracking branch 'upstream/2018.08-rc' into ap1
This commit is contained in:
commit
e45206ae5d
17 changed files with 81 additions and 58 deletions
|
@ -30,6 +30,10 @@ function bookmarklet_content(App $a)
|
|||
$page = normalise_link(System::baseUrl() . "/bookmarklet");
|
||||
|
||||
if (!strstr($referer, $page)) {
|
||||
if (empty($_REQUEST["url"])) {
|
||||
System::httpExit(400, ["title" => L10n::t('Bad Request')]);
|
||||
}
|
||||
|
||||
$content = add_page_info($_REQUEST["url"]);
|
||||
|
||||
$x = [
|
||||
|
|
|
@ -47,6 +47,11 @@ function contacts_init(App $a)
|
|||
if (!DBA::isResult($contact)) {
|
||||
$contact = DBA::selectFirst('contact', [], ['id' => $contact_id, 'uid' => 0]);
|
||||
}
|
||||
|
||||
// Don't display contacts that are about to be deleted
|
||||
if ($contact['network'] == Protocol::PHANTOM) {
|
||||
$contact = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (DBA::isResult($contact)) {
|
||||
|
@ -719,6 +724,8 @@ function contacts_content(App $a, $update = 0)
|
|||
$sql_extra = " AND `blocked` = 0 ";
|
||||
}
|
||||
|
||||
$sql_extra .= sprintf(" AND `network` != '%s' ", Protocol::PHANTOM);
|
||||
|
||||
$search = x($_GET, 'search') ? notags(trim($_GET['search'])) : '';
|
||||
$nets = x($_GET, 'nets' ) ? notags(trim($_GET['nets'])) : '';
|
||||
|
||||
|
|
|
@ -79,13 +79,13 @@ function dfrn_notify_post(App $a) {
|
|||
$condition = [];
|
||||
switch ($direction) {
|
||||
case (-1):
|
||||
$condition = ["`issued-id` = ? OR `dfrn-id` = ?", $dfrn_id, $dfrn_id];
|
||||
$condition = ["(`issued-id` = ? OR `dfrn-id` = ?) AND `uid` = ?", $dfrn_id, $dfrn_id, $user['uid']];
|
||||
break;
|
||||
case 0:
|
||||
$condition = ['issued-id' => $dfrn_id, 'duplex' => true];
|
||||
$condition = ['issued-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
|
||||
break;
|
||||
case 1:
|
||||
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true];
|
||||
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
|
||||
break;
|
||||
default:
|
||||
System::xmlExit(3, 'Invalid direction');
|
||||
|
@ -287,15 +287,15 @@ function dfrn_notify_content(App $a) {
|
|||
$condition = [];
|
||||
switch ($direction) {
|
||||
case (-1):
|
||||
$condition = ["`issued-id` = ? OR `dfrn-id` = ?", $dfrn_id, $dfrn_id];
|
||||
$condition = ["(`issued-id` = ? OR `dfrn-id` = ?) AND `uid` = ?", $dfrn_id, $dfrn_id, $user['uid']];
|
||||
$my_id = $dfrn_id;
|
||||
break;
|
||||
case 0:
|
||||
$condition = ['issued-id' => $dfrn_id, 'duplex' => true];
|
||||
$condition = ['issued-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
|
||||
$my_id = '1:' . $dfrn_id;
|
||||
break;
|
||||
case 1:
|
||||
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true];
|
||||
$condition = ['dfrn-id' => $dfrn_id, 'duplex' => true, 'uid' => $user['uid']];
|
||||
$my_id = '0:' . $dfrn_id;
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -25,7 +25,7 @@ function fetch_init(App $a)
|
|||
|
||||
// Fetch the item
|
||||
$fields = ['uid', 'title', 'body', 'guid', 'contact-id', 'private', 'created', 'app', 'location', 'coord', 'network',
|
||||
'event-id', 'resource-id', 'author-link', 'owner-link', 'attach'];
|
||||
'event-id', 'resource-id', 'author-link', 'author-avatar', 'author-name', 'plink', 'owner-link', 'attach'];
|
||||
$condition = ['wall' => true, 'private' => false, 'guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
|
||||
$item = Item::selectFirst($fields, $condition);
|
||||
if (!DBA::isResult($item)) {
|
||||
|
|
|
@ -70,8 +70,11 @@ function notes_content(App $a, $update = false)
|
|||
$count = 0;
|
||||
|
||||
if (DBA::isResult($r)) {
|
||||
$count = count($r);
|
||||
$o .= conversation($a, DBA::toArray($r), 'notes', $update);
|
||||
$notes = DBA::toArray($r);
|
||||
|
||||
$count = count($notes);
|
||||
|
||||
$o .= conversation($a, $notes, 'notes', $update);
|
||||
}
|
||||
|
||||
$o .= alt_pager($a, $count);
|
||||
|
|
|
@ -132,6 +132,11 @@ function notifications_content(App $a)
|
|||
|
||||
$notif_tpl = get_markup_template('notifications.tpl');
|
||||
|
||||
$notif_show_lnk = [
|
||||
'href' => ($show ? 'notifications/' . $notifs['ident'] : 'notifications/' . $notifs['ident'] . '?show=all' ),
|
||||
'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
|
||||
];
|
||||
|
||||
// Process the data for template creation
|
||||
if (defaults($notifs, 'ident', '') === 'introductions') {
|
||||
$sugg = get_markup_template('suggestions.tpl');
|
||||
|
@ -303,11 +308,6 @@ function notifications_content(App $a)
|
|||
$notif_nocontent = L10n::t('No more %s notifications.', $notifs['ident']);
|
||||
}
|
||||
|
||||
$notif_show_lnk = [
|
||||
'href' => ($show ? 'notifications/' . $notifs['ident'] : 'notifications/' . $notifs['ident'] . '?show=all' ),
|
||||
'text' => ($show ? L10n::t('Show unread') : L10n::t('Show all')),
|
||||
];
|
||||
|
||||
$o .= replace_macros($notif_tpl, [
|
||||
'$notif_header' => $notif_header,
|
||||
'$tabs' => $tabs,
|
||||
|
|
|
@ -212,7 +212,7 @@ function photos_post(App $a)
|
|||
}
|
||||
|
||||
// Check if the user has responded to a delete confirmation query
|
||||
if ($_REQUEST['canceled']) {
|
||||
if (!empty($_REQUEST['canceled'])) {
|
||||
goaway($_SESSION['photo_return']);
|
||||
}
|
||||
|
||||
|
@ -762,12 +762,14 @@ function photos_post(App $a)
|
|||
$filesize = $ret['filesize'];
|
||||
$type = $ret['type'];
|
||||
$error = UPLOAD_ERR_OK;
|
||||
} else {
|
||||
} elseif (!empty($_FILES['userfile'])) {
|
||||
$src = $_FILES['userfile']['tmp_name'];
|
||||
$filename = basename($_FILES['userfile']['name']);
|
||||
$filesize = intval($_FILES['userfile']['size']);
|
||||
$type = $_FILES['userfile']['type'];
|
||||
$error = $_FILES['userfile']['error'];
|
||||
} else {
|
||||
$error = UPLOAD_ERR_NO_FILE;
|
||||
}
|
||||
|
||||
if ($error !== UPLOAD_ERR_OK) {
|
||||
|
|
|
@ -41,14 +41,14 @@ function salmon_post(App $a, $xml = '') {
|
|||
$base = null;
|
||||
|
||||
// figure out where in the DOM tree our data is hiding
|
||||
if($dom->provenance->data)
|
||||
if (!empty($dom->provenance->data))
|
||||
$base = $dom->provenance;
|
||||
elseif($dom->env->data)
|
||||
elseif (!empty($dom->env->data))
|
||||
$base = $dom->env;
|
||||
elseif($dom->data)
|
||||
elseif (!empty($dom->data))
|
||||
$base = $dom;
|
||||
|
||||
if(! $base) {
|
||||
if (empty($base)) {
|
||||
logger('unable to locate salmon data in xml ');
|
||||
System::httpExit(400);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ function webfinger_content(App $a)
|
|||
$o = '<h3>Webfinger Diagnostic</h3>';
|
||||
|
||||
$o .= '<form action="webfinger" method="get">';
|
||||
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
|
||||
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . defaults($_GET, 'addr', '') .'" />';
|
||||
$o .= '<input type="submit" name="submit" value="Submit" /></form>';
|
||||
|
||||
$o .= '<br /><br />';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue