]> git.mxchange.org Git - friendica.git/commitdiff
Don't assume $a->contact is populated in Object\Post::getCommentBox
authorHypolite Petovan <hypolite@mrpetovan.com>
Tue, 11 May 2021 02:03:51 +0000 (22:03 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Tue, 11 May 2021 02:03:51 +0000 (22:03 -0400)
- Address https://github.com/friendica/friendica/issues/10167#issuecomment-837238584
- This might reveal some side-effect

src/Object/Post.php

index ba8c709de85edb12fa2c3368589f8a01ff2c1b04..2e6eb1bf6e986e588d1d05e327d85713f28c063c 100644 (file)
@@ -950,9 +950,9 @@ class Post
                                '$qcomment'    => $qcomment,
                                '$default'     => $default_text,
                                '$profile_uid' => $uid,
-                               '$mylink'      => DI::baseUrl()->remove($a->contact['url']),
+                               '$mylink'      => DI::baseUrl()->remove($a->contact['url'] ?? ''),
                                '$mytitle'     => DI::l10n()->t('This is you'),
-                               '$myphoto'     => DI::baseUrl()->remove($a->contact['thumb']),
+                               '$myphoto'     => DI::baseUrl()->remove($a->contact['thumb'] ?? ''),
                                '$comment'     => DI::l10n()->t('Comment'),
                                '$submit'      => DI::l10n()->t('Submit'),
                                '$loading'     => DI::l10n()->t('Loading...'),