]> 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
index ffaae5588d1eae757e07e15ac654f27056d168fc..817ef4eb166cc9f97225443fd57ac564e4a63bb2 100755 (executable)
@@ -31,7 +31,7 @@ for local users and groups.
 
 END_OF_USERROLE_HELP;
 
-require_once INSTALLDIR.'/scripts/commandline.inc';
+require_once INSTALLDIR.'/scripts/commandline.inc.php';
 
 $dry = have_option('dry-run');
 
@@ -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";