From 951800eca6045f6e0dc1e9a12c225c8e55b044e9 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Thu, 14 Nov 2024 18:40:15 +0000 Subject: Several issues discovered by PHPStan --- include/channel.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'include/channel.php') diff --git a/include/channel.php b/include/channel.php index 0ece3be74..a3ba1a765 100644 --- a/include/channel.php +++ b/include/channel.php @@ -96,6 +96,8 @@ function validate_channelname($name) { if (x($arr, 'message')) return $arr['message']; + + return null; } @@ -2428,7 +2430,7 @@ function get_zcard($channel, $observer_hash = '', $args = array()) { $cover = [ 'href' => z_root() . '/images/default_cover_photos/' . $default_cover . '/' . $cover_width . '.png' ]; } - $o .= replace_macros(get_markup_template('zcard.tpl'), array( + return replace_macros(get_markup_template('zcard.tpl'), array( '$maxwidth' => $maxwidth, '$scale' => $scale, '$translate' => $translate, @@ -2437,8 +2439,6 @@ function get_zcard($channel, $observer_hash = '', $args = array()) { '$pphoto' => $pphoto, '$zcard' => $zcard )); - - return $o; } @@ -2505,17 +2505,13 @@ function get_zcard_embed($channel, $observer_hash = '', $args = array()) { $cover = [ 'href' => z_root() . '/images/default_cover_photos/' . $default_cover . '/' . $cover_width . '.png' ]; } - $o .= replace_macros(get_markup_template('zcard_embed.tpl'),array( + return replace_macros(get_markup_template('zcard_embed.tpl'),array( '$maxwidth' => $maxwidth, - '$scale' => $scale, - '$translate' => $translate, '$size' => $size, '$cover' => $cover, '$pphoto' => $pphoto, '$zcard' => $zcard )); - - return $o; } /** -- cgit v1.2.3