]> git.mxchange.org Git - friendica.git/commitdiff
Add check for $_REQUEST key existence in Module\Item\Compose
authorHypolite Petovan <hypolite@mrpetovan.com>
Thu, 19 Dec 2019 12:48:08 +0000 (07:48 -0500)
committerHypolite Petovan <hypolite@mrpetovan.com>
Thu, 19 Dec 2019 12:48:08 +0000 (07:48 -0500)
- Addresses https://github.com/friendica/friendica/issues/7677#issuecomment-566254464

src/Module/Item/Compose.php

index db44ee3d14449975abda86df5e3346d05f64b238..b9cda4863e28ab1999dbf8befa4a8bff5dc0ab37 100644 (file)
@@ -85,15 +85,20 @@ class Compose extends BaseModule
                                $type = 'post';
                                $doesFederate = true;
 
-                               if ($_REQUEST['contact_allow']
-                                       . $_REQUEST['group_allow']
-                                       . $_REQUEST['contact_deny']
-                                   . $_REQUEST['group_deny'])
+                               $contact_allow = $_REQUEST['contact_allow'] ?? '';
+                               $group_allow = $_REQUEST['group_allow'] ?? '';
+                               $contact_deny = $_REQUEST['contact_deny'] ?? '';
+                               $group_deny = $_REQUEST['group_deny'] ?? '';
+
+                               if ($contact_allow
+                                       . $group_allow
+                                       . $contact_deny
+                                   . $group_deny)
                                {
-                                       $contact_allow_list = $_REQUEST['contact_allow'] ? explode(',', $_REQUEST['contact_allow']) : [];
-                                       $group_allow_list   = $_REQUEST['group_allow']   ? explode(',', $_REQUEST['group_allow'])   : [];
-                                       $contact_deny_list  = $_REQUEST['contact_deny']  ? explode(',', $_REQUEST['contact_deny'])  : [];
-                                       $group_deny_list    = $_REQUEST['group_deny']    ? explode(',', $_REQUEST['group_deny'])    : [];
+                                       $contact_allow_list = $contact_allow ? explode(',', $contact_allow) : [];
+                                       $group_allow_list   = $group_allow   ? explode(',', $group_allow)   : [];
+                                       $contact_deny_list  = $contact_deny  ? explode(',', $contact_deny)  : [];
+                                       $group_deny_list    = $group_deny    ? explode(',', $group_deny)    : [];
                                }
 
                                break;