Good news, everyone - again somce notices removed

This commit is contained in:
Michael 2018-09-04 17:48:09 +00:00
parent f9177e827e
commit 821429fdf1
5 changed files with 22 additions and 17 deletions

View file

@ -54,11 +54,11 @@ function events_post(App $a) {
$cid = (x($_POST, 'cid') ? intval($_POST['cid']) : 0);
$uid = local_user();
$start_text = escape_tags($_REQUEST['start_text']);
$finish_text = escape_tags($_REQUEST['finish_text']);
$start_text = escape_tags(defaults($_REQUEST, 'start_text', ''));
$finish_text = escape_tags(defaults($_REQUEST, 'finish_text', ''));
$adjust = intval($_POST['adjust']);
$nofinish = intval($_POST['nofinish']);
$adjust = intval(defaults($_POST, 'adjust', 0));
$nofinish = intval(defaults($_POST, 'nofinish', 0));
// The default setting for the `private` field in event_store() is false, so mirror that
$private_event = false;
@ -91,9 +91,9 @@ function events_post(App $a) {
// and we'll waste a bunch of time responding to it. Time that
// could've been spent doing something else.
$summary = escape_tags(trim($_POST['summary']));
$desc = escape_tags(trim($_POST['desc']));
$location = escape_tags(trim($_POST['location']));
$summary = escape_tags(trim(defaults($_POST, 'summary', '')));
$desc = escape_tags(trim(defaults($_POST, 'desc', '')));
$location = escape_tags(trim(defaults($_POST, 'location', '')));
$type = 'event';
$action = ($event_id == '') ? 'new' : "event/" . $event_id;
@ -117,7 +117,7 @@ function events_post(App $a) {
goaway($onerror_url);
}
$share = (intval($_POST['share']) ? intval($_POST['share']) : 0);
$share = intval(defaults($_POST, 'share', 0));
$c = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1",
intval(local_user())
@ -484,6 +484,8 @@ function events_content(App $a) {
if ($mode === 'new' || $mode === 'copy') {
$acl = ($cid ? '' : ACL::getFullSelectorHTML($a->user, false, $orig_event));
} else {
$acl = '';
}
// If we copy an old event, we need to remove the ID and URI

View file

@ -87,10 +87,11 @@ function notifications_content(App $a)
$perpage = 20;
$startrec = ($page * $perpage) - $perpage;
$notif_header = L10n::t('Notifications');
// Get introductions
if ((($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) {
Nav::setSelected('introductions');
$notif_header = L10n::t('Notifications');
$all = (($a->argc > 2) && ($a->argv[2] == 'all'));
@ -132,12 +133,8 @@ function notifications_content(App $a)
$notif_tpl = get_markup_template('notifications.tpl');
if (!isset($notifs['ident'])) {
logger('Missing data in notifs: ' . json_encode($a->argv), LOGGER_DEBUG);
}
// Process the data for template creation
if ($notifs['ident'] === 'introductions') {
if (defaults($notifs, 'ident', '') === 'introductions') {
$sugg = get_markup_template('suggestions.tpl');
$tpl = get_markup_template("intros.tpl");
@ -280,7 +277,7 @@ function notifications_content(App $a)
}
// Normal notifications (no introductions)
} else {
} elseif (!empty($notifs['notifications'])) {
// The template files we need in different cases for formatting the content
$tpl_item_like = 'notifications_likes_item.tpl';
$tpl_item_dislike = 'notifications_dislikes_item.tpl';

View file

@ -22,7 +22,7 @@ function unfollow_post()
// NOTREACHED
}
if ($_REQUEST['cancel']) {
if (!empty($_REQUEST['cancel'])) {
goaway($return_url);
}

View file

@ -1074,7 +1074,11 @@ class App
$meminfo = [];
foreach ($memdata as $line) {
list($key, $val) = explode(':', $line);
$data = explode(':', $line);
if (count($data) != 2) {
continue;
}
list($key, $val) = $data;
$meminfo[$key] = (int) trim(str_replace('kB', '', $val));
$meminfo[$key] = (int) ($meminfo[$key] / 1024);
}

View file

@ -125,6 +125,8 @@ class HTTPSignature
$key = $key($sig_block['keyId']);
}
logger('Got keyID ' . $sig_block['keyId']);
// We don't use Activity Pub at the moment.
// if (!$key) {
// $result['signer'] = $sig_block['keyId'];