use Friendica\Core\Cache;
use Friendica\Core\Config;
use Friendica\Database\DBA;
-use Friendica\Database\PostUpdate;
use Friendica\Model\Contact;
use Friendica\Model\GContact;
use Friendica\Model\Photo;
private static function updatePhotoAlbums()
{
$r = q("SELECT `uid` FROM `user` WHERE NOT `account_expired` AND NOT `account_removed`");
- if (!DBA::is_result($r)) {
+ if (!DBA::isResult($r)) {
return;
}
// So optimize it
logger("Optimize Table " . $table["Name"], LOGGER_DEBUG);
- q("OPTIMIZE TABLE `%s`", dbesc($table["Name"]));
+ q("OPTIMIZE TABLE `%s`", DBA::escape($table["Name"]));
}
}
$r = q("SELECT `id`, `url` FROM `contact`
WHERE `network` = '%s' AND (`batch` = '' OR `notify` = '' OR `poll` = '' OR pubkey = '')
- ORDER BY RAND() LIMIT 50", dbesc(NETWORK_DIASPORA));
- if (!DBA::is_result($r)) {
+ ORDER BY RAND() LIMIT 50", DBA::escape(NETWORK_DIASPORA));
+ if (!DBA::isResult($r)) {
return;
}
logger("Repair contact " . $contact["id"] . " " . $contact["url"], LOGGER_DEBUG);
q("UPDATE `contact` SET `batch` = '%s', `notify` = '%s', `poll` = '%s', pubkey = '%s' WHERE `id` = %d",
- dbesc($data["batch"]), dbesc($data["notify"]), dbesc($data["poll"]), dbesc($data["pubkey"]),
+ DBA::escape($data["batch"]), DBA::escape($data["notify"]), DBA::escape($data["poll"]), DBA::escape($data["pubkey"]),
intval($contact["id"]));
}
}
// Sometimes there seem to be issues where the "self" contact vanishes.
// We haven't found the origin of the problem by now.
$r = q("SELECT `uid` FROM `user` WHERE NOT EXISTS (SELECT `uid` FROM `contact` WHERE `contact`.`uid` = `user`.`uid` AND `contact`.`self`)");
- if (DBA::is_result($r)) {
+ if (DBA::isResult($r)) {
foreach ($r AS $user) {
logger('Create missing self contact for user ' . $user['uid']);
Contact::createSelfFromUserId($user['uid']);
// Update the global contacts for local users
$r = q("SELECT `uid` FROM `user` WHERE `verified` AND NOT `blocked` AND NOT `account_removed` AND NOT `account_expired`");
- if (DBA::is_result($r)) {
+ if (DBA::isResult($r)) {
foreach ($r AS $user) {
GContact::updateForUser($user["uid"]);
}