]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/scripts/fixup-shadow.php
Merge remote-tracking branch 'upstream/master' into social-master
[quix0rs-gnu-social.git] / plugins / OStatus / scripts / fixup-shadow.php
old mode 100644 (file)
new mode 100755 (executable)
index 2f6a6ff..817ef4e
@@ -156,7 +156,7 @@ while ($oprofile->fetch()) {
     if (preg_match('!/group/(\d+)/id!', $oprofile->getUri(), $matches)) {
         $id = intval($matches[1]);
         $group = Local_group::getKV('group_id', $id);
-        if ($group) {
+        if ($group instanceof Local_group) {
             $nick = $group->nickname;
         } else {
             $nick = '<deleted>';
@@ -165,11 +165,13 @@ while ($oprofile->fetch()) {
     } else if (preg_match('!/user/(\d+)!', $uri, $matches)) {
         $id = intval($matches[1]);
         $user = User::getKV('id', $id);
-        if ($user) {
+
+        if ($user instanceof User) {
             $nick = $user->nickname;
         } else {
             $nick = '<deleted>';
         }
+
         echo "user $id ($nick) hidden by $uri";
     } else {
         echo "$uri matched query, but we don't recognize it.\n";