]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - lib/toselector.php
No more needed (for this fix) but maybe later. So I always only comment them out.
[quix0rs-gnu-social.git] / lib / toselector.php
index bcbfe86ec96ca55c903cd4df874f7f6ff3f0b108..6d424dc259ccc8433c2e5996cd392bc16fe51dbe 100644 (file)
@@ -94,7 +94,7 @@ class ToSelector extends Widget
 
         $groups = $this->user->getGroups();
 
-        while ($groups->fetch()) {
+        while ($groups instanceof User_group && $groups->fetch()) {
             $value = 'group:'.$groups->id;
             if (($this->to instanceof User_group) && $this->to->id == $groups->id) {
                 $default = $value;
@@ -132,6 +132,10 @@ class ToSelector extends Widget
         $toArg = $action->trimmed('notice_to');
         $private = $action->boolean('notice_private');
 
+        if (empty($toArg)) {
+            return;
+        }
+
         list($prefix, $value) = explode(':', $toArg);
         switch ($prefix) {
         case 'group':
@@ -141,8 +145,8 @@ class ToSelector extends Widget
             }
             break;
         case 'profile':
-            $profile = Profile::staticGet('id', $value);
-            $options['replies'] = $profile->getUri();
+            $profile = Profile::getKV('id', $value);
+            $options['replies'] = array($profile->getUri());
             if ($private) {
                 $options['scope'] = Notice::ADDRESSEE_SCOPE;
             }