mirror of
https://github.com/friendica/friendica
synced 2024-11-18 02:23:40 +00:00
Merge pull request #14187 from annando/error
Fix "TypeError: Argument 1 passed to Friendica\Util\Strings::compareLink() must be of the type string, null given"
This commit is contained in:
commit
87da9c98f6
1 changed files with 5 additions and 1 deletions
|
@ -3557,6 +3557,10 @@ class Contact
|
|||
*/
|
||||
public static function magicLinkById(int $cid, string $url = ''): string
|
||||
{
|
||||
if (($url == '') && DI::userSession()->isAuthenticated() && DI::pConfig()->get(DI::userSession()->getLocalUserId(), 'system', 'stay_local')) {
|
||||
return 'contact/' . $cid . '/conversations';
|
||||
}
|
||||
|
||||
$contact = DBA::selectFirst('contact', ['id', 'network', 'url', 'alias', 'uid'], ['id' => $cid]);
|
||||
|
||||
return self::magicLinkByContact($contact, $url);
|
||||
|
@ -3584,7 +3588,7 @@ class Contact
|
|||
return 'contact/' . $contact['id'] . '/conversations';
|
||||
}
|
||||
|
||||
if (Strings::compareLink($contact['url'], $url) || Strings::compareLink($contact['alias'], $url)) {
|
||||
if (Strings::compareLink($contact['url'], $url) || Strings::compareLink($contact['alias'] ?? '', $url)) {
|
||||
$url = '';
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue