Addon::callHooks('contact_edit_post', $_POST);
- $profile_id = intval($_POST['profile-assign']);
+ $profile_id = intval(defaults($_POST, 'profile-assign', 0));
if ($profile_id) {
if (!DBA::exists('profile', ['id' => $profile_id, 'uid' => local_user()])) {
notice(L10n::t('Could not locate selected profile.') . EOL);
$notify = intval($_POST['notify']);
- $fetch_further_information = intval($_POST['fetch_further_information']);
+ $fetch_further_information = intval(defaults($_POST, 'fetch_further_information', 0));
- $ffi_keyword_blacklist = escape_tags(trim($_POST['ffi_keyword_blacklist']));
+ $ffi_keyword_blacklist = escape_tags(trim(defaults($_POST, 'ffi_keyword_blacklist', '')));
- $priority = intval($_POST['poll']);
+ $priority = intval(defaults($_POST, 'poll', 0));
if ($priority > 5 || $priority < 0) {
$priority = 0;
}
// We now have some contact, so we fetch it
$importer = DBA::fetchFirst("SELECT *, `name` as `senderName`
+ '' AS `uprvkey`,
+ 'UTC' AS `timezone`,
+ '' AS `nickname`,
+ '' AS `sprvkey`,
+ '' AS `spubkey`,
+ 0 AS `page-flags`,
+ 0 AS `account-type`,
+ 0 AS `prvnets`
FROM `contact`
WHERE NOT `blocked` AND `id` = ? LIMIT 1",
$contact['id']);
$photo_menu = [];
}
} else {
- $connlnk = System::baseUrl().'/follow/?url='.(($jj->connect) ? $jj->connect : $jj->url);
+ $connlnk = System::baseUrl().'/follow/?url='.(!empty($jj->connect) ? $jj->connect : $jj->url);
$conntxt = L10n::t('Connect');
$photo_menu = [
'profile' => [L10n::t("View Profile"), Contact::magicLink($jj->url)],
}
$a->page['aside'] .= $vcard_widget;
- $a->page['aside'] .= $photo_albums_widget;
+
+ if (!empty($photo_albums_widget)) {
+ $a->page['aside'] .= $photo_albums_widget;
+ }
$tpl = get_markup_template("photos_head.tpl");
// Only arrays are serialized in database, so we have to unserialize sparingly
$value = is_string($v) && preg_match("|^a:[0-9]+:{.*}$|s", $v) ? unserialize($v) : $v;
- if (!isset($this->config[$uid])) {
+ if (!isset($this->config[$uid]) || !is_array($this->config[$uid])) {
$this->config[$uid] = [];
}
- if (!isset($this->config[$uid][$cat])) {
+ if (!isset($this->config[$uid][$cat]) || !is_array($this->config[$uid][$cat])) {
$this->config[$uid][$cat] = [];
}
$return .= sprintf('<h4><a href="%s">%s</a></h4>', $data['url'], $data['title']);
}
- if ($data["description"] != "" && $data["description"] != $data["title"]) {
+ if (!empty($data["description"]) && $data["description"] != $data["title"]) {
// Sanitize the HTML by converting it to BBCode
$bbcode = HTML::toBBCode($data["description"]);
$return .= sprintf('<blockquote>%s</blockquote>', trim(self::convert($bbcode)));
}
// If the link already is included in the post, don't add it again
- if (($data["url"] != "") && strpos($data["text"], $data["url"])) {
+ if (!empty($data["url"]) && strpos($data["text"], $data["url"])) {
return $data["text"] . $data["after"];
}
$text = $data["text"];
- if (($data["url"] != "") && ($data["title"] != "")) {
+ if (!empty($data["url"]) && ($data["title"] != "")) {
$text .= "\n[url=" . $data["url"] . "]" . $data["title"] . "[/url]";
- } elseif (($data["url"] != "")) {
+ } elseif (!empty($data["url"])) {
$text .= "\n[url]" . $data["url"] . "[/url]";
}
$data = Contact::getDetailsByAddr($match[2]);
+ if (empty($data)) {
+ return;
+ }
+
$name = $match[1];
if ($name == '') {
foreach ($ll as $l) {
$l = trim($l, "\t\n\r */");
if ($l != "") {
- list($type, $v) = array_map("trim", explode(":", $l, 2));
+ $addon_info = array_map("trim", explode(":", $l, 2));
+ if (count($addon_info) < 2) {
+ continue;
+ }
+
+ list($type, $v) = $addon_info;
$type = strtolower($type);
if ($type == "author" || $type == "maintainer") {
$r = preg_match("|([^<]+)<([^>]+)>|", $v, $m);
if (!$event['nofinish']) {
$o .= '<div class="event-end" ><span class="event-label">' . L10n::t('Finishes:') . '</span> <span class="dtend" title="'
- . DateTimeFormat::utc($event['finish'], (($event['adjust']) ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s'))
+ . DateTimeFormat::utc($event['finish'], (!empty($event['adjust']) ? DateTimeFormat::ATOM : 'Y-m-d\TH:i:s'))
. '" >' . $event_end
. '</span></div>' . "\r\n";
}
- $o .= '<div class="description event-description">' . BBCode::convert($event['desc'], false, $simple) . '</div>' . "\r\n";
+ if (!empty($event['desc'])) {
+ $o .= '<div class="description event-description">' . BBCode::convert($event['desc'], false, $simple) . '</div>' . "\r\n";
+ }
if (strlen($event['location'])) {
$o .= '<div class="event-location"><span class="event-label">' . L10n::t('Location:') . '</span> <span class="location">'
$contact["alias"] = $contact["url"];
}
+ $contact['account-type'] = $owner['account-type'];
+
return $contact;
}
}
$contact = self::contactEntry($repeated_item['author-link'], $owner);
- $contact['account-type'] = $contact['contact-type'];
$title = $owner["nick"]." repeated a notice by ".$contact["nick"];