aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-09-07 12:50:46 +0000
committerMario <mario@mariovavti.com>2022-09-07 12:50:46 +0000
commitfcfb9e975836c4abbbfd339d46bf8ea937747e57 (patch)
treebbe6a8f19831eba6f9488c8e26687362870e0021
parent9beee689ce5537d0b64f20ccfe461eeb7c41ffa8 (diff)
downloadvolse-hubzilla-fcfb9e975836c4abbbfd339d46bf8ea937747e57.tar.gz
volse-hubzilla-fcfb9e975836c4abbbfd339d46bf8ea937747e57.tar.bz2
volse-hubzilla-fcfb9e975836c4abbbfd339d46bf8ea937747e57.zip
fix random php warnings
-rw-r--r--Zotlabs/Lib/Apps.php7
-rw-r--r--Zotlabs/Module/Acl.php14
-rw-r--r--Zotlabs/Module/Home.php2
-rw-r--r--Zotlabs/Module/Hq.php16
-rw-r--r--Zotlabs/Module/Sse_bs.php2
-rw-r--r--Zotlabs/Widget/Channel_activities.php2
-rw-r--r--Zotlabs/Widget/Messages.php17
-rw-r--r--include/auth.php4
-rw-r--r--include/bbcode.php17
-rw-r--r--include/channel.php6
-rw-r--r--include/conversation.php8
-rw-r--r--include/nav.php8
-rw-r--r--include/security.php3
-rw-r--r--view/theme/redbasic/php/style.php6
14 files changed, 56 insertions, 56 deletions
diff --git a/Zotlabs/Lib/Apps.php b/Zotlabs/Lib/Apps.php
index 98ebc546a..a29992bbc 100644
--- a/Zotlabs/Lib/Apps.php
+++ b/Zotlabs/Lib/Apps.php
@@ -521,8 +521,13 @@ class Apps {
$hosturl = '';
if(local_channel()) {
- if(self::app_installed(local_channel(),$papp) && !$papp['deleted'])
+ if(self::app_installed(local_channel(),$papp)) {
$installed = true;
+ }
+
+ if ($installed && isset($papp['deleted']) && $papp['deleted']) {
+ $installed = false;
+ }
$hosturl = z_root() . '/';
}
diff --git a/Zotlabs/Module/Acl.php b/Zotlabs/Module/Acl.php
index 5b37f2707..9dc422e6b 100644
--- a/Zotlabs/Module/Acl.php
+++ b/Zotlabs/Module/Acl.php
@@ -66,6 +66,11 @@ class Acl extends \Zotlabs\Web\Controller {
killme();
$permitted = [];
+ $sql_extra = '';
+ $sql_extra2 = '';
+ $sql_extra3 = '';
+ $sql_extra2_xchan = '';
+ $order_extra2 = '';
if(in_array($type, [ 'm', 'a', 'c', 'f' ])) {
@@ -81,7 +86,6 @@ class Acl extends \Zotlabs\Web\Controller {
}
-
if($search) {
$sql_extra = " AND pgrp.gname LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ";
$sql_extra2 = "AND ( xchan_name LIKE " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " OR xchan_addr LIKE " . protect_sprintf( "'%" . dbesc(punify($search)) . ((strpos($search,'@') === false) ? "%@%'" : "%'")) . ") ";
@@ -100,10 +104,6 @@ class Acl extends \Zotlabs\Web\Controller {
$sql_extra3 = "AND ( xchan_addr like " . protect_sprintf( "'%" . dbesc(punify($search)) . "%'" ) . " OR xchan_name like " . protect_sprintf( "'%" . dbesc($search) . "%'" ) . " ) ";
}
- else {
- $sql_extra = $sql_extra2 = $sql_extra3 = "";
- }
-
$groups = array();
$contacts = array();
@@ -342,7 +342,7 @@ class Acl extends \Zotlabs\Web\Controller {
$x = [];
foreach($r as $g) {
- if(in_array($g['net'],['rss','anon','unknown']) && ($type != 'a'))
+ if(isset($g['net']) && in_array($g['net'], ['rss','anon','unknown']) && ($type != 'a'))
continue;
$g['hash'] = urlencode($g['hash']);
@@ -383,7 +383,7 @@ class Acl extends \Zotlabs\Web\Controller {
"self" => (intval($g['abook_self']) ? 'abook-self' : ''),
"taggable" => '',
"label" => '',
- "net" => $g['net']
+ "net" => $g['net'] ?? ''
);
}
}
diff --git a/Zotlabs/Module/Home.php b/Zotlabs/Module/Home.php
index 315d05af6..8d78960cc 100644
--- a/Zotlabs/Module/Home.php
+++ b/Zotlabs/Module/Home.php
@@ -36,7 +36,7 @@ class Home extends Controller {
$channel = App::get_channel();
if (local_channel() && $channel && $channel['xchan_url'] && !$splash) {
- $dest = (($ret['startpage']) ? $ret['startpage'] : '');
+ $dest = $ret['startpage'] ?? '';
if (!$dest)
$dest = get_config('system', 'startpage');
if (!$dest)
diff --git a/Zotlabs/Module/Hq.php b/Zotlabs/Module/Hq.php
index efbfcf084..120f7caeb 100644
--- a/Zotlabs/Module/Hq.php
+++ b/Zotlabs/Module/Hq.php
@@ -47,24 +47,10 @@ class Hq extends \Zotlabs\Web\Controller {
$sys = get_sys_channel();
$sys_item = false;
$sql_extra = '';
-
- if(! $item_hash) {
- //$r = q("SELECT mid FROM item
- //WHERE uid = %d $item_normal
- //AND mid = parent_mid
- //AND item_private IN (0, 1)
- //ORDER BY created DESC LIMIT 1",
- //intval(local_channel())
- //);
- //if($r[0]['mid']) {
- //$item_hash = $r[0]['mid'];
- //}
- }
+ $target_item = null;
if($item_hash) {
- $target_item = null;
-
$r = q("select id, uid, mid, parent_mid, thr_parent, verb, item_type, item_deleted, item_blocked from item where mid = '%s' limit 1",
dbesc($item_hash)
);
diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php
index ad9be0938..619050aaf 100644
--- a/Zotlabs/Module/Sse_bs.php
+++ b/Zotlabs/Module/Sse_bs.php
@@ -41,7 +41,7 @@ class Sse_bs extends Controller {
self::$offset = 0;
self::$xchans = '';
- if($_REQUEST['sse_rmids'])
+ if(isset($_REQUEST['sse_rmids']))
self::mark_read($_REQUEST['sse_rmids']);
if(!empty($_REQUEST['nquery']) && $_REQUEST['nquery'] !== '%') {
diff --git a/Zotlabs/Widget/Channel_activities.php b/Zotlabs/Widget/Channel_activities.php
index 47aa971a2..9acde591d 100644
--- a/Zotlabs/Widget/Channel_activities.php
+++ b/Zotlabs/Widget/Channel_activities.php
@@ -25,7 +25,7 @@ class Channel_activities {
self::$uid = local_channel();
self::$channel = App::get_channel();
- $o .= '<div id="channel-activities" class="d-none overflow-hidden">';
+ $o = '<div id="channel-activities" class="d-none overflow-hidden">';
$o .= '<h2 class="mb-4">Welcome ' . self::$channel['channel_name'] . '!</h2>';
//$o .= 'Last login date: ' . get_pconfig(self::$uid, 'system', 'stored_login_date') . ' from ' . get_pconfig(self::$uid, 'system', 'stored_login_addr');
diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php
index 3d9ed8955..66b371c8e 100644
--- a/Zotlabs/Widget/Messages.php
+++ b/Zotlabs/Widget/Messages.php
@@ -45,11 +45,14 @@ class Messages {
if (!local_channel())
return;
- if (isset($options['offset']) && $options['offset'] == -1) {
+ $offset = $options['offset'] ?? 0;
+ $type = $options['type'] ?? 'default';
+
+ if ($offset == -1) {
return;
}
- if (isset($options['type']) && $options['type'] == 'notification') {
+ if ($type == 'notification') {
return self::get_notices_page($options);
}
@@ -58,15 +61,9 @@ class Messages {
$entries = [];
$limit = 30;
$dummy_order_sql = '';
-
- $offset = 0;
- if ($options['offset']) {
- $offset = intval($options['offset']);
- }
-
$loadtime = (($offset) ? $_SESSION['messages_loadtime'] : datetime_convert());
- switch($options['type']) {
+ switch($type) {
case 'direct':
$type_sql = ' AND item_private = 2 ';
// $dummy_order_sql has no other meaning but to trick
@@ -99,7 +96,7 @@ class Messages {
foreach($items as $item) {
$info = '';
- if ($options['type'] == 'direct') {
+ if ($type == 'direct') {
$info .= self::get_dm_recipients($channel, $item);
}
diff --git a/include/auth.php b/include/auth.php
index 07b8e2971..8a83f16fe 100644
--- a/include/auth.php
+++ b/include/auth.php
@@ -189,7 +189,7 @@ if((isset($_SESSION)) && (x($_SESSION, 'authenticated')) &&
call_hooks('logging_out', $args);
- if($_SESSION['delegate'] && $_SESSION['delegate_push']) {
+ if(isset($_SESSION['delegate']) && isset($_SESSION['delegate_push'])) {
$_SESSION = $_SESSION['delegate_push'];
info( t('Delegation session ended.') . EOL);
}
@@ -337,7 +337,7 @@ else {
// (i.e. expire when the browser is closed), even when there's a time expiration
// on the cookie
- $remember = $_POST['main_login_remember'] ?? $_POST['modal_login_remember'];
+ $remember = $_POST['main_login_remember'] ?? $_POST['modal_login_remember'] ?? false;
if($remember) {
$_SESSION['remember_me'] = 1;
diff --git a/include/bbcode.php b/include/bbcode.php
index 794cb25d0..100991afd 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -502,32 +502,37 @@ function bb_ShareAttributes($match) {
$author = "";
preg_match("/author='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$author = urldecode($matches[1]);
+ }
$link = "";
preg_match("/link='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$link = $matches[1];
+ }
$avatar = "";
preg_match("/avatar='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$avatar = $matches[1];
+ }
$profile = "";
preg_match("/profile='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$profile = $matches[1];
+ }
$posted = "";
preg_match("/posted='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "")
+ if (isset($matches[1]) && $matches[1] !== '') {
$posted = $matches[1];
+ }
$auth = "";
preg_match("/auth='(.*?)'/ism", $attributes, $matches);
- if ($matches[1] != "") {
+ if (isset($matches[1]) && $matches[1] !== '') {
if($matches[1] === 'true')
$auth = true;
else
diff --git a/include/channel.php b/include/channel.php
index 4e84b1b32..0d02dff1e 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -2002,7 +2002,7 @@ function atoken_delete_and_sync($channel_id, $atoken_guid) {
* @return int
*/
function get_theme_uid() {
- $uid = (($_REQUEST['puid']) ? intval($_REQUEST['puid']) : 0);
+ $uid = $_REQUEST['puid'] ?? 0;
if(local_channel()) {
if((get_pconfig(local_channel(),'system','always_my_theme')) || (! $uid))
return local_channel();
@@ -2010,10 +2010,10 @@ function get_theme_uid() {
if(! $uid) {
$x = get_sys_channel();
if($x)
- return $x['channel_id'];
+ return intval($x['channel_id']);
}
- return $uid;
+ return intval($uid);
}
/**
diff --git a/include/conversation.php b/include/conversation.php
index 685e6b15b..d450bc609 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -1431,7 +1431,13 @@ function hz_status_editor($a, $x, $popup = false) {
];
call_hooks('jot_header_tpl_filter',$tplmacros);
- App::$page['htmlhead'] .= replace_macros($tpl, $tplmacros);
+
+ if (isset(App::$page['htmlhead'])) {
+ App::$page['htmlhead'] .= replace_macros($tpl, $tplmacros);
+ }
+ else {
+ App::$page['htmlhead'] = replace_macros($tpl, $tplmacros);
+ }
$tpl = get_markup_template('jot.tpl');
diff --git a/include/nav.php b/include/nav.php
index c2c87232b..0097a206b 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -19,6 +19,8 @@ function nav($template = 'default') {
App::$page['htmlhead'] .= '<script>$(document).ready(function() { $("#nav-search-text").search_autocomplete(\'' . z_root() . '/acl' . '\');});</script>';
$is_owner = (((local_channel()) && ((App::$profile_uid == local_channel()) || (App::$profile_uid == 0))) ? true : false);
$observer = App::get_observer();
+ $chans = [];
+
if (local_channel()) {
$channel = App::get_channel();
@@ -35,7 +37,7 @@ function nav($template = 'default') {
$sitelocation = (($is_owner) ? '' : App::$profile['reddress']);
}
else {
- $sitelocation = ((App::$profile['reddress']) ? App::$profile['reddress'] : '@' . App::get_hostname());
+ $sitelocation = ((isset(App::$profile['reddress'])) ? App::$profile['reddress'] : '@' . App::get_hostname());
}
require_once('include/conversation.php');
@@ -336,8 +338,8 @@ function nav($template = 'default') {
'$featured_apps' => t('Featured Apps'),
'$url' => (($url) ? $url : z_root() . '/' . App::$cmd),
'$settings_url' => $settings_url,
- '$name' => ((!$is_owner) ? App::$profile['fullname'] : ''),
- '$thumb' => ((!$is_owner) ? App::$profile['thumb'] : ''),
+ '$name' => ((!$is_owner && isset(App::$profile['fullname'])) ? App::$profile['fullname'] : ''),
+ '$thumb' => ((!$is_owner && isset(App::$profile['thumb'])) ? App::$profile['thumb'] : ''),
'$form_security_token' => get_form_security_token('pconfig')
]);
diff --git a/include/security.php b/include/security.php
index 881adb818..de9f1f337 100644
--- a/include/security.php
+++ b/include/security.php
@@ -604,7 +604,8 @@ function public_permissions_sql($observer_hash) {
function get_form_security_token($typename = '') {
$timestamp = time();
- $sec_hash = hash('whirlpool', App::$observer['xchan_guid'] . ((local_channel()) ? App::$channel['channel_prvkey'] : '') . session_id() . $timestamp . $typename);
+ $guid = App::$observer['xchan_guid'] ?? '';
+ $sec_hash = hash('whirlpool', $guid . ((local_channel()) ? App::$channel['channel_prvkey'] : '') . session_id() . $timestamp . $typename);
return $timestamp . '.' . $sec_hash;
}
diff --git a/view/theme/redbasic/php/style.php b/view/theme/redbasic/php/style.php
index 45790ae37..667377838 100644
--- a/view/theme/redbasic/php/style.php
+++ b/view/theme/redbasic/php/style.php
@@ -22,6 +22,7 @@ if(! App::$install) {
$background_image = get_pconfig($uid, 'redbasic', 'background_image');
$item_colour = get_pconfig($uid, 'redbasic', 'item_colour');
$comment_item_colour = get_pconfig($uid, 'redbasic', 'comment_item_colour');
+ $item_opacity = get_pconfig($uid, 'redbasic', 'item_opacity');
$font_size = get_pconfig($uid, 'redbasic', 'font_size');
$font_colour = get_pconfig($uid, 'redbasic', 'font_colour');
$radius = get_pconfig($uid, 'redbasic', 'radius');
@@ -64,6 +65,7 @@ if ((!$schema) || ($schema == '---')) {
require_once ($schemefile);
}
+ $schemecss = '';
if(file_exists('view/theme/redbasic/schema/default.css')) {
$schemecss = file_get_contents('view/theme/redbasic/schema/default.css');
}
@@ -150,12 +152,8 @@ if(file_exists('view/theme/redbasic/css/style.css')) {
'$radius' => $radius,
'$shadow' => $shadow,
'$converse_width' => $converse_width,
- '$nav_float_min_opacity' => $nav_float_min_opacity,
- '$nav_percent_min_opacity' => $nav_percent_min_opacity,
'$top_photo' => $top_photo,
'$reply_photo' => $reply_photo,
- '$pmenu_top' => $pmenu_top,
- '$pmenu_reply' => $pmenu_reply,
'$main_width' => $main_width,
'$left_aside_width' => $left_aside_width,
'$right_aside_width' => $right_aside_width