From: Hypolite Petovan <hypolite@mrpetovan.com>
Date: Wed, 29 May 2019 01:08:48 +0000 (-0400)
Subject: Prevent fatal error in ACL::getFullSelectorHTML when accessing a profile as a remote... 
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5414d51d4cde2b18dffa1c8ec922d9e2c1371132;p=friendica.git

Prevent fatal error in ACL::getFullSelectorHTML when accessing a profile as a remote visitor

See https://github.com/friendica/friendica/issues/6916#issuecomment-495724811
---

diff --git a/src/Core/ACL.php b/src/Core/ACL.php
index e6c82fd4bf..ec31ddb7cd 100644
--- a/src/Core/ACL.php
+++ b/src/Core/ACL.php
@@ -259,7 +259,7 @@ class ACL extends BaseObject
 	 * @return string
 	 * @throws \Friendica\Network\HTTPException\InternalServerErrorException
 	 */
-	public static function getFullSelectorHTML(array $user, $show_jotnets = false, array $default_permissions = [])
+	public static function getFullSelectorHTML(array $user = null, $show_jotnets = false, array $default_permissions = [])
 	{
 		// Defaults user permissions
 		if (empty($default_permissions)) {
@@ -314,7 +314,7 @@ class ACL extends BaseObject
 			'$aclModalTitle' => L10n::t('Permissions'),
 			'$aclModalDismiss' => L10n::t('Close'),
 			'$features' => [
-				'aclautomention' => Feature::isEnabled($user['uid'], 'aclautomention') ? 'true' : 'false'
+				'aclautomention' => !empty($user['uid']) && Feature::isEnabled($user['uid'], 'aclautomention') ? 'true' : 'false'
 			],
 		]);