aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario Vavti <mario@mariovavti.com>2022-10-20 11:15:06 +0200
committerMario Vavti <mario@mariovavti.com>2022-10-20 11:15:06 +0200
commit53931017b99c6fc77fc7632747e51b06a89b2287 (patch)
tree26357decc1d3a76471863b3f58a0a0455d637e33 /include
parente9ca17cec14c5a702cc7d656e5206a3c086dd550 (diff)
downloadvolse-hubzilla-53931017b99c6fc77fc7632747e51b06a89b2287.tar.gz
volse-hubzilla-53931017b99c6fc77fc7632747e51b06a89b2287.tar.bz2
volse-hubzilla-53931017b99c6fc77fc7632747e51b06a89b2287.zip
fix php warnings
Diffstat (limited to 'include')
-rw-r--r--include/channel.php8
-rw-r--r--include/hubloc.php4
-rw-r--r--include/items.php3
-rw-r--r--include/nav.php8
4 files changed, 11 insertions, 12 deletions
diff --git a/include/channel.php b/include/channel.php
index a309fa5c8..a42315ed6 100644
--- a/include/channel.php
+++ b/include/channel.php
@@ -1890,18 +1890,18 @@ function advanced_profile() {
function get_my_url() {
- if(x($_SESSION, 'zrl_override'))
+ if(isset($_SESSION['zrl_override']) && $_SESSION['zrl_override'])
return $_SESSION['zrl_override'];
- if(x($_SESSION, 'my_url'))
+ if(isset($_SESSION['my_url']) && $_SESSION['my_url'])
return $_SESSION['my_url'];
return false;
}
function get_my_address() {
- if(x($_SESSION, 'zid_override'))
+ if(isset($_SESSION['zid_override']) && $_SESSION['zid_override'])
return $_SESSION['zid_override'];
- if(x($_SESSION, 'my_address'))
+ if(isset($_SESSION['my_address']) && $_SESSION['my_address'])
return $_SESSION['my_address'];
return false;
diff --git a/include/hubloc.php b/include/hubloc.php
index 6401d1f0d..bf5d8f120 100644
--- a/include/hubloc.php
+++ b/include/hubloc.php
@@ -137,11 +137,11 @@ function remove_obsolete_hublocs() {
// Do we have any invalid ones?
- $r = q("select hubloc_id from hubloc where hubloc_sitekey = '%s' and hubloc_url != '%s'",
+ $r = q("select hubloc_id, hubloc_hash from hubloc where hubloc_sitekey = '%s' and hubloc_url != '%s'",
dbesc(get_config('system', 'pubkey')),
dbesc(z_root())
);
- $p = q("select hubloc_id from hubloc where hubloc_sitekey != '%s' and hubloc_url = '%s'",
+ $p = q("select hubloc_id, hubloc_hash from hubloc where hubloc_sitekey != '%s' and hubloc_url = '%s'",
dbesc(get_config('system', 'pubkey')),
dbesc(z_root())
);
diff --git a/include/items.php b/include/items.php
index 28b311021..8a244db2f 100644
--- a/include/items.php
+++ b/include/items.php
@@ -3757,8 +3757,7 @@ function item_expire($uid,$days,$comment_days = 7) {
// don't expire filed items
- $terms = get_terms_oftype($item['term'],TERM_FILE);
- if($terms) {
+ if (isset($item['term']) && get_terms_oftype($item['term'], TERM_FILE)) {
retain_item($item['id']);
continue;
}
diff --git a/include/nav.php b/include/nav.php
index 71b3bec49..29d99aaee 100644
--- a/include/nav.php
+++ b/include/nav.php
@@ -110,12 +110,12 @@ function nav($template = 'default') {
$nav['logout'] = ['logout', t('Logout'), "", t('End this session'), 'logout_nav_btn'];
// user menu
- $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), ((App::$nav_sel['raw_name'] == 'Profile') ? 'active' : ''), t('Your profile page'), 'profile_nav_btn'];
+ $nav['usermenu'][] = ['profile/' . $channel['channel_address'], t('View Profile'), ((isset(App::$nav_sel['raw_name']) && App::$nav_sel['raw_name'] == 'Profile') ? 'active' : ''), t('Your profile page'), 'profile_nav_btn'];
if (feature_enabled(local_channel(), 'multi_profiles'))
- $nav['usermenu'][] = ['profiles', t('Edit Profiles'), ((App::$nav_sel['raw_name'] == 'Profiles') ? 'active' : ''), t('Manage/Edit profiles'), 'profiles_nav_btn'];
+ $nav['usermenu'][] = ['profiles', t('Edit Profiles'), ((isset(App::$nav_sel['raw_name']) && App::$nav_sel['raw_name'] == 'Profiles') ? 'active' : ''), t('Manage/Edit profiles'), 'profiles_nav_btn'];
else
- $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'), ((App::$nav_sel['raw_name'] == 'Profiles') ? 'active' : ''), t('Edit your profile'), 'profiles_nav_btn'];
+ $nav['usermenu'][] = ['profiles/' . $prof[0]['id'], t('Edit Profile'), ((isset(App::$nav_sel['raw_name']) && App::$nav_sel['raw_name'] == 'Profiles') ? 'active' : ''), t('Edit your profile'), 'profiles_nav_btn'];
}
else {
@@ -276,7 +276,7 @@ function nav($template = 'default') {
if ($pinned_list) {
foreach ($pinned_list as $app) {
- if (App::$nav_sel['name'] == $app['name'])
+ if (isset(App::$nav_sel['name']) && App::$nav_sel['name'] == $app['name'])
$app['active'] = true;
if ($is_owner) {