* @return boolean was the insert successful?
* @throws \Exception
*/
- public function insert($table, $param, $on_duplicate_update = false)
+ public function insert($table, array $param, bool $on_duplicate_update = false)
{
if (empty($table) || empty($param)) {
$this->logger->info('Table and fields have to be set');
* @hooks 'profile_sidebar'
* array $arr
*/
- private static function sidebar(App $a, $profile, $block = 0, $show_connect = true)
+ private static function sidebar(App $a, array $profile, $block = 0, $show_connect = true)
{
$o = '';
$location = false;
// This function can also use contact information in $profile
$is_contact = !empty($profile['cid']);
- if (!is_array($profile) && !count($profile)) {
+ if (empty($profile['nickname'])) {
+ Logger::warning('Received profile with no nickname', ['profile' => $profile, 'callstack' => System::callstack(10)]);
return $o;
}
$subscribe_feed_link = null;
$wallmessage_link = null;
-
-
$visitor_contact = [];
if (!empty($profile['uid']) && self::getMyURL()) {
$visitor_contact = Contact::selectFirst(['rel'], ['uid' => $profile['uid'], 'nurl' => Strings::normaliseLink(self::getMyURL())]);
$sql_values[] = $group;
}
- $sql_extra .= Widget::unavailableNetworks();
-
$total = 0;
$stmt = DBA::p("SELECT COUNT(*) AS `total`
FROM `contact`
WHERE `uid` = ?
AND `self` = 0
AND NOT `deleted`
- $sql_extra",
+ $sql_extra
+ " . Widget::unavailableNetworks(),
$sql_values
);
if (DBA::isResult($stmt)) {