aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-09-15 09:19:55 +0000
committerMario <mario@mariovavti.com>2022-09-15 09:19:55 +0000
commit118a5edebc745fe2760f781c8bb9e9006bf6215f (patch)
treef5162ba06cc2ec32b685fd566b086ed9e52d7b33 /Zotlabs
parent1b4333e8d9c37fcf1d0cb9f952009757a2131528 (diff)
downloadvolse-hubzilla-118a5edebc745fe2760f781c8bb9e9006bf6215f.tar.gz
volse-hubzilla-118a5edebc745fe2760f781c8bb9e9006bf6215f.tar.bz2
volse-hubzilla-118a5edebc745fe2760f781c8bb9e9006bf6215f.zip
fix warnings and regressions
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Onepoll.php3
-rw-r--r--Zotlabs/Lib/Activity.php2
-rw-r--r--Zotlabs/Lib/Libzot.php4
-rw-r--r--Zotlabs/Lib/Queue.php2
-rw-r--r--Zotlabs/Module/Contactedit.php4
-rw-r--r--Zotlabs/Module/Wfinger.php2
-rw-r--r--Zotlabs/Photo/PhotoDriver.php2
-rw-r--r--Zotlabs/Web/HTTPHeaders.php4
-rw-r--r--Zotlabs/Web/HTTPSig.php6
9 files changed, 18 insertions, 11 deletions
diff --git a/Zotlabs/Daemon/Onepoll.php b/Zotlabs/Daemon/Onepoll.php
index 79fd06df9..f2b5d8c58 100644
--- a/Zotlabs/Daemon/Onepoll.php
+++ b/Zotlabs/Daemon/Onepoll.php
@@ -46,6 +46,7 @@ class Onepoll {
}
$contact = $contacts[0];
+
$importer_uid = $contact['abook_channel'];
$importer = channelx_by_n($importer_uid);
@@ -53,7 +54,7 @@ class Onepoll {
if (!$importer)
return;
- logger("onepoll: poll: ({$contact['id']}) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
+ logger("onepoll: poll: ($contact_id) IMPORTER: {$importer['xchan_name']}, CONTACT: {$contact['xchan_name']}");
$last_update = ((($contact['abook_updated'] === $contact['abook_created']) || ($contact['abook_updated'] <= NULL_DATE))
? datetime_convert('UTC', 'UTC', 'now - 7 days')
diff --git a/Zotlabs/Lib/Activity.php b/Zotlabs/Lib/Activity.php
index 372ef3dd7..4ff13bc04 100644
--- a/Zotlabs/Lib/Activity.php
+++ b/Zotlabs/Lib/Activity.php
@@ -1618,7 +1618,7 @@ class Activity {
}
$icon = z_root() . '/' . get_default_profile_photo(300);
- if ($person_obj['icon']) {
+ if (isset($person_obj['icon'])) {
if (is_array($person_obj['icon'])) {
if (array_key_exists('url', $person_obj['icon'])) {
$icon = $person_obj['icon']['url'];
diff --git a/Zotlabs/Lib/Libzot.php b/Zotlabs/Lib/Libzot.php
index 8bf3c51d5..2486f7d67 100644
--- a/Zotlabs/Lib/Libzot.php
+++ b/Zotlabs/Lib/Libzot.php
@@ -251,7 +251,7 @@ class Libzot {
$url = null;
- if ($them['hubloc_id_url']) {
+ if (isset($them['hubloc_id_url']) && $them['hubloc_id_url']) {
$url = $them['hubloc_id_url'];
}
else {
@@ -1744,7 +1744,7 @@ class Libzot {
if (in_array('undefined', $existing_route) || $last_hop == 'undefined' || $sender == 'undefined')
$last_hop = '';
- $current_route = (($arr['route']) ? $arr['route'] . ',' : '') . $sender;
+ $current_route = ((isset($arr['route']) && $arr['route']) ? $arr['route'] . ',' : '') . $sender;
if ($last_hop && $last_hop != $sender) {
logger('comment route mismatch: parent route = ' . $r[0]['route'] . ' expected = ' . $current_route, LOGGER_DEBUG);
diff --git a/Zotlabs/Lib/Queue.php b/Zotlabs/Lib/Queue.php
index a646aee6d..c3f9cda20 100644
--- a/Zotlabs/Lib/Queue.php
+++ b/Zotlabs/Lib/Queue.php
@@ -116,7 +116,7 @@ class Queue {
$driver = $arr['driver'] ?? 'zot6';
$posturl = $arr['posturl'] ?? '';
$priority = $arr['priority'] ?? 0;
- $priority = $arr['notify'] ?? '';
+ $notify = $arr['notify'] ?? '';
$msg = $arr['msg'] ?? '';
$x = q("insert into outq ( outq_hash, outq_account, outq_channel, outq_driver, outq_posturl, outq_async, outq_priority,
diff --git a/Zotlabs/Module/Contactedit.php b/Zotlabs/Module/Contactedit.php
index f0fb89d3b..58c3380a1 100644
--- a/Zotlabs/Module/Contactedit.php
+++ b/Zotlabs/Module/Contactedit.php
@@ -452,8 +452,8 @@ class Contactedit extends Controller {
if (is_ajax()) {
json_return_and_die([
- 'success' => ((intval($_REQUEST['success'])) ? intval($_REQUEST['success']) : 1),
- 'message' => (($_REQUEST['success']) ? t('Contact updated') : t('Contact update failed')),
+ 'success' => ((isset($_REQUEST['success'])) ? intval($_REQUEST['success']) : 1),
+ 'message' => ((isset($_REQUEST['success'])) ? t('Contact updated') : t('Contact update failed')),
'id' => $contact_id,
'title' => $header_html,
'role' => ((intval($contact['abook_pending'])) ? '' : $roles_dict[$current_permcat]),
diff --git a/Zotlabs/Module/Wfinger.php b/Zotlabs/Module/Wfinger.php
index 6d0e78587..048fcde3f 100644
--- a/Zotlabs/Module/Wfinger.php
+++ b/Zotlabs/Module/Wfinger.php
@@ -21,7 +21,7 @@ class Wfinger extends \Zotlabs\Web\Controller {
elseif(x($_SERVER,'HTTP_X_FORWARDED_PROTO') && ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'))
$scheme = 'https';
- $zot = intval($_REQUEST['zot']);
+ $zot = $_REQUEST['zot'] ?? '';
if(($scheme !== 'https') && (! $zot)) {
header($_SERVER["SERVER_PROTOCOL"] . ' ' . 500 . ' ' . 'Webfinger requires HTTPS');
diff --git a/Zotlabs/Photo/PhotoDriver.php b/Zotlabs/Photo/PhotoDriver.php
index 7439ab401..fc34f87a9 100644
--- a/Zotlabs/Photo/PhotoDriver.php
+++ b/Zotlabs/Photo/PhotoDriver.php
@@ -483,7 +483,7 @@ abstract class PhotoDriver {
where id = %d",
intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), dbesc($p['resource_id']), dbescdate($p['created']), dbescdate($p['edited']), dbesc(basename($p['filename'])), dbesc($p['mimetype']), dbesc($p['album']), intval($p['height']), intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), dbesc($p['description']), dbesc($p['os_path']), dbesc($p['display_path']), dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), dbesc($p['deny_gid']), dbescdate($p['expires']), intval($p['profile']), intval($x[0]['id']));
} else {
- $p['created'] = (($arr['created']) ? $arr['created'] : $p['edited']);
+ $p['created'] = $arr['created'] ?? $p['edited'];
$r = q("INSERT INTO photo
( aid, uid, xchan, resource_id, created, edited, filename, mimetype, album, height, width, content, os_storage, filesize, imgscale, photo_usage, title, description, os_path, display_path, allow_cid, allow_gid, deny_cid, deny_gid, expires, profile )
VALUES ( %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d, %d, '%s', %d, %d, %d, %d, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', %d)", intval($p['aid']), intval($p['uid']), dbesc($p['xchan']), dbesc($p['resource_id']), dbescdate($p['created']), dbescdate($p['edited']), dbesc(basename($p['filename'])), dbesc($p['mimetype']), dbesc($p['album']), intval($p['height']), intval($p['width']), (intval($p['os_storage']) ? dbescbin($p['os_syspath']) : dbescbin($this->imageString())), intval($p['os_storage']), (intval($p['os_storage']) ? @filesize($p['os_syspath']) : strlen($this->imageString())), intval($p['imgscale']), intval($p['photo_usage']), dbesc($p['title']), dbesc($p['description']), dbesc($p['os_path']), dbesc($p['display_path']), dbesc($p['allow_cid']), dbesc($p['allow_gid']), dbesc($p['deny_cid']), dbesc($p['deny_gid']), dbescdate($p['expires']), intval($p['profile']));
diff --git a/Zotlabs/Web/HTTPHeaders.php b/Zotlabs/Web/HTTPHeaders.php
index 4be51a8f3..902d637f7 100644
--- a/Zotlabs/Web/HTTPHeaders.php
+++ b/Zotlabs/Web/HTTPHeaders.php
@@ -20,7 +20,7 @@ class HTTPHeaders {
}
}
else {
- if($this->in_progress['k']) {
+ if(isset($this->in_progress['k'])) {
$this->parsed[] = [ $this->in_progress['k'] => $this->in_progress['v'] ];
$this->in_progress = [];
}
@@ -30,7 +30,7 @@ class HTTPHeaders {
}
}
- if($this->in_progress['k']) {
+ if(isset($this->in_progress['k'])) {
$this->parsed[] = [ $this->in_progress['k'] => $this->in_progress['v'] ];
$this->in_progress = [];
}
diff --git a/Zotlabs/Web/HTTPSig.php b/Zotlabs/Web/HTTPSig.php
index cb41c2b7d..35b8054e6 100644
--- a/Zotlabs/Web/HTTPSig.php
+++ b/Zotlabs/Web/HTTPSig.php
@@ -299,6 +299,7 @@ class HTTPSig {
// Check the local cache first, but remove any fragments like #main-key since these won't be present in our cached data
$url = ((strpos($id, '#')) ? substr($id, 0, strpos($id, '#')) : $id);
+ $best = [];
// $force is used to ignore the local cache and only use the remote data; for instance the cached key might be stale
if (!$force) {
@@ -374,6 +375,8 @@ class HTTPSig {
static function get_webfinger_key($id, $force = false) {
+ $best = [];
+
if (!$force) {
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' and hubloc_network in ('zot6', 'activitypub') order by hubloc_id desc",
dbesc($id)
@@ -420,6 +423,9 @@ class HTTPSig {
*/
static function get_zotfinger_key($id, $force = false) {
+
+ $best = [];
+
if (!$force) {
$x = q("select * from xchan left join hubloc on xchan_hash = hubloc_hash where hubloc_id_url = '%s' and hubloc_network = 'zot6' order by hubloc_id desc",
dbesc($id)