]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Only set selectVerbs if it's not set in class var
authorMikael Nordfeldth <mmn@hethane.se>
Thu, 21 Jan 2016 01:37:38 +0000 (02:37 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Thu, 21 Jan 2016 01:37:38 +0000 (02:37 +0100)
lib/noticestream.php

index 3b597fa08cf03899ca42406084fad93dc5c99d8b..01c5ee4a72e56e970aec2db641f26daf63b3300d 100644 (file)
@@ -46,13 +46,17 @@ if (!defined('STATUSNET')) {
  */
 abstract class NoticeStream
 {
-    protected $selectVerbs = array();
-    protected $unselectVerbs = array();
+    protected $selectVerbs   = null;    // must be set to array
+    protected $unselectVerbs = null;    // must be set to array
 
     public function __construct()
     {
-        $this->selectVerbs = array(ActivityVerb::POST, ActivityUtils::resolveUri(ActivityVerb::POST, true));
-        $this->unselectVerbs = array(ActivityVerb::DELETE);
+        if ($this->selectVerbs === null) {
+            $this->selectVerbs = array(ActivityVerb::POST, ActivityUtils::resolveUri(ActivityVerb::POST, true));
+        }
+        if ($this->unselectVerbs === null) {
+            $this->unselectVerbs = array(ActivityVerb::DELETE);
+        }
     }
 
     abstract function getNoticeIds($offset, $limit, $since_id, $max_id);