Add null/empty string parameter value case in BBCode::convert

- Remove obsolete coalesce operator uses
This commit is contained in:
Hypolite Petovan 2020-06-08 19:15:08 -04:00
parent 0c1e876ee0
commit 89b3ae2657
6 changed files with 11 additions and 6 deletions

View file

@ -1252,8 +1252,13 @@ class BBCode
* @return string
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
public static function convert($text, $try_oembed = true, $simple_html = self::INTERNAL, $for_plaintext = false)
public static function convert(string $text = null, $try_oembed = true, $simple_html = self::INTERNAL, $for_plaintext = false)
{
// Accounting for null default column values
if (is_null($text) || $text === '') {
return '';
}
$a = DI::app();
$text = self::performWithEscapedTags($text, ['code'], function ($text) use ($try_oembed, $simple_html, $for_plaintext, $a) {