X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Frepair_ostatus.php;h=3acaa687a712942a959edbfaee62e5141a79cb91;hb=761bdafa34bfdf1b2b43a3f06ae092e0925898ac;hp=a1695127e6732b2466aab301a7d5bf0ba9b161ca;hpb=e06fc2aa6900d8cf5ae4e8d5cf52f9262bf7ada7;p=friendica.git diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php index a1695127e6..3acaa687a7 100644 --- a/mod/repair_ostatus.php +++ b/mod/repair_ostatus.php @@ -26,28 +26,29 @@ function repair_ostatus_content(App $a) { $counter = intval($_REQUEST['counter']); - $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE - `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)", - intval($uid), - DBA::escape(Protocol::OSTATUS), - intval(Contact::FRIEND), - intval(Contact::SHARING)); - - if (!$r) - return($o.L10n::t("Error")); + $r = q("SELECT COUNT(*) AS `total` FROM `contact` WHERE + `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d)", + intval($uid), + DBA::escape(Protocol::OSTATUS), + intval(Contact::FRIEND), + intval(Contact::SHARING)); + + if (!DBA::isResult($r)) { + return ($o . L10n::t("Error")); + } $total = $r[0]["total"]; - $r = q("SELECT `url` FROM `contact` WHERE - `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d) + $r = q("SELECT `url` FROM `contact` WHERE + `uid` = %d AND `network` = '%s' AND `rel` IN (%d, %d) ORDER BY `url` LIMIT %d, 1", - intval($uid), - DBA::escape(Protocol::OSTATUS), - intval(Contact::FRIEND), - intval(Contact::SHARING), $counter++); + intval($uid), + DBA::escape(Protocol::OSTATUS), + intval(Contact::FRIEND), + intval(Contact::SHARING), $counter++); - if (!$r) { + if (!DBA::isResult($r)) { $o .= L10n::t("Done"); return $o; }