if ($show_in_notification_page) {
$notification = DI::notify()->insert([
'name' => $params['source_name'] ?? '',
- 'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'] ?? '')), 0, 255),
+ 'name_cache' => substr(strip_tags(BBCode::convert($params['source_name'])), 0, 255),
'url' => $params['source_link'] ?? '',
'photo' => $params['source_photo'] ?? '',
'link' => $itemlink ?? '',
'$photo' => $profile['photo'],
'$addr' => $profile['addr'] ?: '',
'$account_type' => $account_type,
- '$about' => BBCode::convert($profile['about'] ?: ''),
+ '$about' => BBCode::convert($profile['about']),
]);
$cal_widget = Widget\CalendarExport::getHTML();
'$photo' => $profile['photo'],
'$addr' => $profile['addr'] ?? '',
'$account_type' => $account_type,
- '$about' => BBCode::convert($profile['about'] ?? ''),
+ '$about' => BBCode::convert($profile['about']),
]);
$albums = Photo::getAlbums($a->data['user']['uid']);
'$photo' => $profile['photo'],
'$addr' => $profile['addr'] ?? '',
'$account_type' => $account_type,
- '$about' => BBCode::convert($profile['about'] ?? ''),
+ '$about' => BBCode::convert($profile['about']),
]);
// If not there, create 'aside' empty
* @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) {
private function setNameCache()
{
try {
- $this->name_cache = strip_tags(BBCode::convert($this->source_name ?? ''));
+ $this->name_cache = strip_tags(BBCode::convert($this->source_name));
} catch (InternalServerErrorException $e) {
}
}