aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-02-02 17:58:29 +0000
committerMario <mario@mariovavti.com>2022-02-02 17:58:29 +0000
commit1740ae2104ff734edd45f6c0f1273d561cc4a69c (patch)
treed63c6d59f7f673193e9141b48c48bdee2b7fdbe9 /include
parentd8372f84339b29ef05f92d452ec196df32087f4a (diff)
downloadvolse-hubzilla-1740ae2104ff734edd45f6c0f1273d561cc4a69c.tar.gz
volse-hubzilla-1740ae2104ff734edd45f6c0f1273d561cc4a69c.tar.bz2
volse-hubzilla-1740ae2104ff734edd45f6c0f1273d561cc4a69c.zip
more PHP 8.1 deprecated warnings
Diffstat (limited to 'include')
-rw-r--r--include/contact_widgets.php4
-rw-r--r--include/conversation.php4
-rw-r--r--include/items.php4
-rw-r--r--include/text.php2
-rw-r--r--include/zid.php2
5 files changed, 10 insertions, 6 deletions
diff --git a/include/contact_widgets.php b/include/contact_widgets.php
index 875a519a5..1ae8b17c5 100644
--- a/include/contact_widgets.php
+++ b/include/contact_widgets.php
@@ -100,6 +100,10 @@ function categories_widget($baseurl,$selected = '') {
\Zotlabs\Daemon\Master::Summon([ 'Cache_query', $key, base64_encode(json_encode($arr)) ]);
}
+ if (!$content) {
+ return EMPTY_STR;
+ }
+
$r = unserialize($content);
$terms = [];
diff --git a/include/conversation.php b/include/conversation.php
index 17367856c..c0238b8ae 100644
--- a/include/conversation.php
+++ b/include/conversation.php
@@ -558,7 +558,7 @@ function conversation($items, $mode, $update, $page_mode = 'traditional', $prepa
$page_writeable = ($profile_owner == local_channel());
if (!$update) {
- $tab = notags(trim($_GET['tab']));
+ $tab = notags(trim((string)$_GET['tab']));
if ($tab === 'posts') {
// This is ugly, but we can't pass the profile_uid through the session to the ajax updater,
// because browser prefetching might change it on us. We have to deliver it with the page.
@@ -974,7 +974,7 @@ function best_link_url($item) {
}
}
if(! $best_url) {
- if(strlen($item['author-link']))
+ if($item['author-link'])
$best_url = $item['author-link'];
else
$best_url = $item['url'];
diff --git a/include/items.php b/include/items.php
index e198ea54f..0b33d876d 100644
--- a/include/items.php
+++ b/include/items.php
@@ -1446,7 +1446,7 @@ function activity_sanitise($arr) {
if(is_array($x))
$ret[$k] = activity_sanitise($x);
else
- $ret[$k] = htmlspecialchars($x, ENT_COMPAT, 'UTF-8', false);
+ $ret[$k] = htmlspecialchars((string)$x, ENT_COMPAT, 'UTF-8', false);
}
return $ret;
}
@@ -4438,7 +4438,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
);
}
- if(strlen($arr['file'])) {
+ if($arr['file']) {
$sql_extra .= term_query('item',$arr['files'],TERM_FILE);
}
diff --git a/include/text.php b/include/text.php
index 2e5e728a0..29a2ab3b1 100644
--- a/include/text.php
+++ b/include/text.php
@@ -846,7 +846,7 @@ function activity_match($haystack,$needle) {
if($needle) {
foreach($needle as $n) {
- if(($haystack === $n) || (strtolower(basename($n)) === strtolower(basename($haystack)))) {
+ if(($haystack === $n) || (strtolower(basename((string)$n)) === strtolower(basename((string)$haystack)))) {
return true;
}
}
diff --git a/include/zid.php b/include/zid.php
index e462f8357..ae7d9e252 100644
--- a/include/zid.php
+++ b/include/zid.php
@@ -37,7 +37,7 @@ function is_matrix_url($url) {
* @return string
*/
function zid($s, $address = '') {
- if (! strlen($s) || strpos($s,'zid='))
+ if (!$s || strpos($s,'zid='))
return $s;
$m = parse_url($s);