<?php
/**
- * @copyright Copyright (C) 2010-2022, the Friendica project
+ * @copyright Copyright (C) 2010-2024, the Friendica project
*
* @license GNU AGPL version 3 or any later version
*
// view infos about a known profile (needs a login)
$which = $a->getLoggedInUserNickname();
} else {
- System::jsonError(403, 'Authentication required');
+ $this->jsonError(403, 'Authentication required');
}
$owner = User::getOwnerDataByNick($which);
if (empty($owner['uid'])) {
- System::jsonError(404, 'Profile not found');
+ $this->jsonError(404, 'Profile not found');
}
$json_info = [
if (!$owner['net-publish']) {
$json_info['hide'] = true;
- System::jsonExit($json_info);
+ $this->jsonExit($json_info);
}
$keywords = $owner['pub_keywords'] ?? '';
// We display the last activity (post or login), reduced to year and week number
$last_active = strtotime($owner['last-item']);
- if ($last_active < strtotime($owner['last-activity'])) {
+ if ($owner['last-activity'] && $last_active < strtotime($owner['last-activity'])) {
$last_active = strtotime($owner['last-activity']);
}
$json_info['last-activity'] = date('o-W', $last_active);
}
}
- System::jsonExit($json_info);
+ $this->jsonExit($json_info);
}
}