From 25194b58b8fa80f5257753d79ad7ee749b80ae2f Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 29 Nov 2019 11:33:48 -0500 Subject: [PATCH 1/3] Initialize class members in App\Page - Addresses https://github.com/friendica/friendica/issues/7676#issuecomment-559680658 --- src/App/Page.php | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/src/App/Page.php b/src/App/Page.php index 7b3bc286f3..ca98bb6b23 100644 --- a/src/App/Page.php +++ b/src/App/Page.php @@ -30,15 +30,26 @@ class Page implements ArrayAccess /** * @var array Contains all stylesheets, which should get loaded during page */ - private $stylesheets; + private $stylesheets = []; /** * @var array Contains all scripts, which are added to the footer at last */ - private $footerScripts; + private $footerScripts = []; /** * @var array The page content, which are showed directly */ - private $page; + private $page = [ + 'aside' => '', + 'bottom' => '', + 'content' => '', + 'footer' => '', + 'htmlhead' => '', + 'nav' => '', + 'page_title' => '', + 'right_aside' => '', + 'template' => '', + 'title' => '', + ]; /** * @var string The basepath of the page */ @@ -50,19 +61,6 @@ class Page implements ArrayAccess public function __construct(string $basepath) { $this->basePath = $basepath; - - $this->page = [ - 'aside' => '', - 'bottom' => '', - 'content' => '', - 'footer' => '', - 'htmlhead' => '', - 'nav' => '', - 'page_title' => '', - 'right_aside' => '', - 'template' => '', - 'title' => '' - ]; } /** From 0ff4381305457dcb01fcd735a1766f391c5d8ede Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 29 Nov 2019 11:39:49 -0500 Subject: [PATCH 2/3] Ensure the existence of expected default permission keys in ACL::getFullSelectorHTML - Addresses https://sozialwolke.net/display/703b8751-145d-e11f-a923-98e999239905 --- src/Core/ACL.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Core/ACL.php b/src/Core/ACL.php index 880a1e47ff..0eb2ecc8b3 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -333,6 +333,13 @@ class ACL extends BaseObject // Defaults user permissions if (empty($default_permissions)) { $default_permissions = self::getDefaultUserPermissions($user); + } else { + $default_permissions = [ + 'allow_cid' => $default_permissions['allow_cid'] ?? [], + 'allow_gid' => $default_permissions['allow_gid'] ?? [], + 'deny_cid' => $default_permissions['deny_cid'] ?? [], + 'deny_gid' => $default_permissions['deny_gid'] ?? [], + ]; } if (count($default_permissions['allow_cid']) From 3a7ef7893f498ee841366ce6949ebed2aa00e7fc Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Fri, 29 Nov 2019 15:55:52 -0500 Subject: [PATCH 3/3] Fix typo in ACL::getFullSelectorHTML --- src/Core/ACL.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/ACL.php b/src/Core/ACL.php index 0eb2ecc8b3..3f163216e3 100644 --- a/src/Core/ACL.php +++ b/src/Core/ACL.php @@ -359,7 +359,7 @@ class ACL extends BaseObject $pubmail_enabled = false; if (function_exists('imap_open') && !Config::get('system', 'imap_disabled')) { - $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['Ășid']]); + $mailacct = DBA::selectFirst('mailacct', ['pubmail'], ['`uid` = ? AND `server` != ""', $user['uid']]); if (DBA::isResult($mailacct)) { $mail_enabled = true; $pubmail_enabled = !empty($mailacct['pubmail']);