mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-17 04:45:16 +02:00
Notices again (#5543)
* And again notices * Notices in the directory * Much more places * Fix some double $ * Notice in ping * Missing field * Fix: We now remove deleted users from the directory * Some more stuff * Notices when removing users * Added logging * More logging * Two more
This commit is contained in:
parent
c960a97682
commit
c72c64a6d8
17 changed files with 95 additions and 57 deletions
|
@ -32,7 +32,8 @@ function dfrn_poll_init(App $a)
|
|||
$quiet = x($_GET, 'quiet');
|
||||
|
||||
// Possibly it is an OStatus compatible server that requests a user feed
|
||||
if (($a->argc > 1) && ($dfrn_id == '') && !strstr($_SERVER["HTTP_USER_AGENT"], 'Friendica')) {
|
||||
$user_agent = defaults($_SERVER, 'HTTP_USER_AGENT', '');
|
||||
if (($a->argc > 1) && ($dfrn_id == '') && !strstr($user_agent, 'Friendica')) {
|
||||
$nickname = $a->argv[1];
|
||||
header("Content-type: application/atom+xml");
|
||||
echo OStatus::feed($nickname, $last_update, 10);
|
||||
|
|
|
@ -422,7 +422,7 @@ function dfrn_request_post(App $a)
|
|||
intval($uid),
|
||||
intval($contact_record['id']),
|
||||
((x($_POST,'knowyou') && ($_POST['knowyou'] == 1)) ? 1 : 0),
|
||||
DBA::escape(notags(trim($_POST['dfrn-request-message']))),
|
||||
DBA::escape(notags(trim(defaults($_POST, 'dfrn-request-message', '')))),
|
||||
DBA::escape($hash),
|
||||
DBA::escape(DateTimeFormat::utcNow())
|
||||
);
|
||||
|
|
|
@ -76,6 +76,8 @@ function directory_content(App $a)
|
|||
(`profile`.`education` LIKE '%$search%') OR
|
||||
(`profile`.`pub_keywords` LIKE '%$search%') OR
|
||||
(`profile`.`prv_keywords` LIKE '%$search%'))";
|
||||
} else {
|
||||
$sql_extra = '';
|
||||
}
|
||||
|
||||
$publish = (Config::get('system', 'publish_all') ? '' : " AND `publish` = 1 " );
|
||||
|
@ -147,6 +149,8 @@ function directory_content(App $a)
|
|||
|| (x($profile, 'country-name') == 1)
|
||||
) {
|
||||
$location = L10n::t('Location:');
|
||||
} else {
|
||||
$location = '';
|
||||
}
|
||||
|
||||
$gender = ((x($profile, 'gender') == 1) ? L10n::t('Gender:') : false);
|
||||
|
|
|
@ -22,7 +22,7 @@ function group_init(App $a) {
|
|||
|
||||
function group_post(App $a) {
|
||||
|
||||
if (! local_user()) {
|
||||
if (!local_user()) {
|
||||
notice(L10n::t('Permission denied.') . EOL);
|
||||
return;
|
||||
}
|
||||
|
@ -45,21 +45,21 @@ function group_post(App $a) {
|
|||
return; // NOTREACHED
|
||||
}
|
||||
|
||||
if (($a->argc == 2) && (intval($a->argv[1]))) {
|
||||
if (($a->argc == 2) && intval($a->argv[1])) {
|
||||
check_form_security_token_redirectOnErr('/group', 'group_edit');
|
||||
|
||||
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d LIMIT 1",
|
||||
intval($a->argv[1]),
|
||||
intval(local_user())
|
||||
);
|
||||
if (! DBA::isResult($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
notice(L10n::t('Group not found.') . EOL);
|
||||
goaway(System::baseUrl() . '/contacts');
|
||||
return; // NOTREACHED
|
||||
}
|
||||
$group = $r[0];
|
||||
$groupname = notags(trim($_POST['groupname']));
|
||||
if ((strlen($groupname)) && ($groupname != $group['name'])) {
|
||||
if (strlen($groupname) && ($groupname != $group['name'])) {
|
||||
$r = q("UPDATE `group` SET `name` = '%s' WHERE `uid` = %d AND `id` = %d",
|
||||
DBA::escape($groupname),
|
||||
intval(local_user()),
|
||||
|
@ -79,13 +79,13 @@ function group_post(App $a) {
|
|||
function group_content(App $a) {
|
||||
$change = false;
|
||||
|
||||
if (! local_user()) {
|
||||
if (!local_user()) {
|
||||
notice(L10n::t('Permission denied') . EOL);
|
||||
return;
|
||||
}
|
||||
|
||||
// Switch to text mode interface if we have more than 'n' contacts or group members
|
||||
|
||||
|
||||
if ($a->argc == 1) {
|
||||
goaway(System::baseUrl() . '/contacts');
|
||||
}
|
||||
|
@ -113,11 +113,13 @@ function group_content(App $a) {
|
|||
|
||||
}
|
||||
|
||||
$nogroup = false;
|
||||
|
||||
if (($a->argc == 2) && ($a->argv[1] === 'none')) {
|
||||
require_once 'mod/contacts.php';
|
||||
|
||||
$id = -1;
|
||||
$nogroup = True;
|
||||
$nogroup = true;
|
||||
$group = [
|
||||
'id' => $id,
|
||||
'name' => L10n::t('Contacts not in any group'),
|
||||
|
@ -173,7 +175,7 @@ function group_content(App $a) {
|
|||
}
|
||||
}
|
||||
|
||||
if (($a->argc > 1) && (intval($a->argv[1]))) {
|
||||
if (($a->argc > 1) && intval($a->argv[1])) {
|
||||
require_once 'mod/contacts.php';
|
||||
|
||||
$r = q("SELECT * FROM `group` WHERE `id` = %d AND `uid` = %d AND `deleted` = 0 LIMIT 1",
|
||||
|
@ -181,7 +183,7 @@ function group_content(App $a) {
|
|||
intval(local_user())
|
||||
);
|
||||
|
||||
if (! DBA::isResult($r)) {
|
||||
if (!DBA::isResult($r)) {
|
||||
notice(L10n::t('Group not found.') . EOL);
|
||||
goaway(System::baseUrl() . '/contacts');
|
||||
}
|
||||
|
@ -234,7 +236,7 @@ function group_content(App $a) {
|
|||
|
||||
}
|
||||
|
||||
if (! isset($group)) {
|
||||
if (!isset($group)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -279,7 +281,7 @@ function group_content(App $a) {
|
|||
if (DBA::isResult($r)) {
|
||||
// Format the data of the contacts who aren't in the contact group
|
||||
foreach ($r as $member) {
|
||||
if (! in_array($member['id'], $preselected)) {
|
||||
if (!in_array($member['id'], $preselected)) {
|
||||
$entry = _contact_detail_for_template($member);
|
||||
$entry['label'] = 'contacts';
|
||||
if (!$nogroup)
|
||||
|
|
|
@ -108,7 +108,7 @@ function ping_init(App $a)
|
|||
|
||||
if (local_user()) {
|
||||
// Different login session than the page that is calling us.
|
||||
if (intval($_GET['uid']) && intval($_GET['uid']) != local_user()) {
|
||||
if (!empty($_GET['uid']) && intval($_GET['uid']) != local_user()) {
|
||||
$data = ['result' => ['invalid' => 1]];
|
||||
|
||||
if ($format == 'json') {
|
||||
|
@ -347,7 +347,7 @@ function ping_init(App $a)
|
|||
|
||||
if (DBA::isResult($notifs)) {
|
||||
// Are the nofications called from the regular process or via the friendica app?
|
||||
$regularnotifications = (intval($_GET['uid']) && intval($_GET['_']));
|
||||
$regularnotifications = (!empty($_GET['uid']) && !empty($_GET['_']));
|
||||
|
||||
foreach ($notifs as $notif) {
|
||||
if ($a->is_friendica_app() || !$regularnotifications) {
|
||||
|
|
|
@ -23,7 +23,7 @@ function probe_content(App $a)
|
|||
|
||||
$o .= '<br /><br />';
|
||||
|
||||
if (x($_GET, 'addr')) {
|
||||
if (!empty($_GET['addr'])) {
|
||||
$addr = trim($_GET['addr']);
|
||||
$res = Probe::uri($addr, "", 0, false);
|
||||
$o .= '<pre>';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue