}
// Check if we should do HTML-based delete confirmation
- if ($_REQUEST['confirm']) {
+ if (!empty($_REQUEST['confirm'])) {
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
'$cancel' => L10n::t('Cancel'),
]);
}
+
// Now check how the user responded to the confirmation query
- if ($_REQUEST['canceled']) {
+ if (!empty($_REQUEST['canceled'])) {
goaway($_SESSION['return_url']);
}
$cmd = $a->argv[1];
if ($cmd === 'drop') {
- if (dba::delete('mail', ['id' => $a->argv[2]])) {
+ if (dba::delete('mail', ['id' => $a->argv[2], 'uid' => local_user()])) {
info(L10n::t('Message deleted.') . EOL);
}
+
//goaway(System::baseUrl(true) . '/message' );
goaway($_SESSION['return_url']);
} else {
WHERE `mail`.`uid` = %d $sql_extra ORDER BY `mail`.`created` ASC",
intval(local_user())
);
+ } else {
+ $messages = false;
}
- if (!count($messages)) {
+ if (!DBM::is_result($messages)) {
notice(L10n::t('Message not available.') . EOL);
return $o;
}
if ($message['from-url'] == $myprofile) {
$from_url = $myprofile;
$sparkle = '';
- } elseif ($message['contact-id'] != 0) {
- $from_url = 'redir/' . $message['contact-id'];
- $sparkle = ' sparkle';
} else {
- $from_url = $message['from-url'] . "?zrl=" . urlencode($myprofile);
+ $from_url = Contact::magicLink($message['from-url']);
$sparkle = ' sparkle';
}
$rslt .= replace_macros($tpl, [
'$id' => $rr['id'],
'$from_name' => $participants,
- '$from_url' => (($rr['network'] === NETWORK_DFRN) ? 'redir/' . $rr['contact-id'] : $rr['url']),
+ '$from_url' => Contact::magicLink($rr['url']),
'$from_addr' => $contact['addr'],
'$sparkle' => ' sparkle',
'$from_photo' => proxy_url($from_photo, false, PROXY_SIZE_THUMB),