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); $cid = (x($_POST, 'cid') ? intval($_POST['cid']) : 0);
$uid = local_user(); $uid = local_user();
$start_text = escape_tags($_REQUEST['start_text']); $start_text = escape_tags(defaults($_REQUEST, 'start_text', ''));
$finish_text = escape_tags($_REQUEST['finish_text']); $finish_text = escape_tags(defaults($_REQUEST, 'finish_text', ''));
$adjust = intval($_POST['adjust']); $adjust = intval(defaults($_POST, 'adjust', 0));
$nofinish = intval($_POST['nofinish']); $nofinish = intval(defaults($_POST, 'nofinish', 0));
// The default setting for the `private` field in event_store() is false, so mirror that // The default setting for the `private` field in event_store() is false, so mirror that
$private_event = false; $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 // and we'll waste a bunch of time responding to it. Time that
// could've been spent doing something else. // could've been spent doing something else.
$summary = escape_tags(trim($_POST['summary'])); $summary = escape_tags(trim(defaults($_POST, 'summary', '')));
$desc = escape_tags(trim($_POST['desc'])); $desc = escape_tags(trim(defaults($_POST, 'desc', '')));
$location = escape_tags(trim($_POST['location'])); $location = escape_tags(trim(defaults($_POST, 'location', '')));
$type = 'event'; $type = 'event';
$action = ($event_id == '') ? 'new' : "event/" . $event_id; $action = ($event_id == '') ? 'new' : "event/" . $event_id;
@ -117,7 +117,7 @@ function events_post(App $a) {
goaway($onerror_url); 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", $c = q("SELECT `id` FROM `contact` WHERE `uid` = %d AND `self` LIMIT 1",
intval(local_user()) intval(local_user())
@ -484,6 +484,8 @@ function events_content(App $a) {
if ($mode === 'new' || $mode === 'copy') { if ($mode === 'new' || $mode === 'copy') {
$acl = ($cid ? '' : ACL::getFullSelectorHTML($a->user, false, $orig_event)); $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 // 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; $perpage = 20;
$startrec = ($page * $perpage) - $perpage; $startrec = ($page * $perpage) - $perpage;
$notif_header = L10n::t('Notifications');
// Get introductions // Get introductions
if ((($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) { if ((($a->argc > 1) && ($a->argv[1] == 'intros')) || (($a->argc == 1))) {
Nav::setSelected('introductions'); Nav::setSelected('introductions');
$notif_header = L10n::t('Notifications');
$all = (($a->argc > 2) && ($a->argv[2] == 'all')); $all = (($a->argc > 2) && ($a->argv[2] == 'all'));
@ -132,12 +133,8 @@ function notifications_content(App $a)
$notif_tpl = get_markup_template('notifications.tpl'); $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 // Process the data for template creation
if ($notifs['ident'] === 'introductions') { if (defaults($notifs, 'ident', '') === 'introductions') {
$sugg = get_markup_template('suggestions.tpl'); $sugg = get_markup_template('suggestions.tpl');
$tpl = get_markup_template("intros.tpl"); $tpl = get_markup_template("intros.tpl");
@ -280,7 +277,7 @@ function notifications_content(App $a)
} }
// Normal notifications (no introductions) // Normal notifications (no introductions)
} else { } elseif (!empty($notifs['notifications'])) {
// The template files we need in different cases for formatting the content // The template files we need in different cases for formatting the content
$tpl_item_like = 'notifications_likes_item.tpl'; $tpl_item_like = 'notifications_likes_item.tpl';
$tpl_item_dislike = 'notifications_dislikes_item.tpl'; $tpl_item_dislike = 'notifications_dislikes_item.tpl';

View file

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

View file

@ -1074,7 +1074,11 @@ class App
$meminfo = []; $meminfo = [];
foreach ($memdata as $line) { 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) trim(str_replace('kB', '', $val));
$meminfo[$key] = (int) ($meminfo[$key] / 1024); $meminfo[$key] = (int) ($meminfo[$key] / 1024);
} }

View file

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