X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FUtil%2FImages.php;h=aed72f065b7c8c0810efa22c0aaa938ca6c7c46c;hb=911ed3d6ba98149ed6d400d554e7a0e10bd1c273;hp=7f6d8720ff0bb5f89942670da2546abbfd131671;hpb=7c266be2064907ab3a23bfd6b7ee31b64fc661de;p=friendica.git diff --git a/src/Util/Images.php b/src/Util/Images.php index 7f6d8720ff..aed72f065b 100644 --- a/src/Util/Images.php +++ b/src/Util/Images.php @@ -327,7 +327,7 @@ class Images * @param string $description * @return string */ - public static function getBBCodeByResource(string $resource_id, string $nickname, int $preview, string $ext, string $description = null): string + public static function getBBCodeByResource(string $resource_id, string $nickname, int $preview, string $ext, string $description = ''): string { return self::getBBCodeByUrl( DI::baseUrl() . '/photos/' . $nickname . '/image/' . $resource_id, @@ -344,20 +344,12 @@ class Images * @param string $description * @return string */ - public static function getBBCodeByUrl(string $photo, string $preview = null, string $description = null): string + public static function getBBCodeByUrl(string $photo, string $preview = null, string $description = ''): string { if (!empty($preview)) { - if (!is_null($description)) { - return '[url=' . $photo . '][img=' . $preview . ']' . $description . '[/img][/url]'; - } else { - return '[url=' . $photo . '][img]' . $preview . '[/img][/url]'; - } + return '[url=' . $photo . '][img=' . $preview . ']' . $description . '[/img][/url]'; } - if (!is_null($description)) { - return '[img=' . $photo . ']' . $description . '[/img]'; - } else { - return '[img]' . $photo . '[/img]'; - } + return '[img=' . $photo . ']' . $description . '[/img]'; } }