use dba;
require_once 'boot.php';
+require_once 'include/dba.php';
require_once 'include/text.php';
/**
* up or some other transient event and that there's a possibility we could recover from it.
*
* @param array $contact contact to mark for archival
- * @return type
+ * @return null
*/
public static function markForArchival(array $contact)
{
if (!DBM::is_result($contact)) {
// The link could be provided as http although we stored it as https
$ssl_url = str_replace('http://', 'https://', $url);
- $r = dba::select('contact', array('id', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
+ $r = dba::select('contact', array('id', 'avatar', 'avatar-date'), array('`alias` IN (?, ?, ?) AND `uid` = ?', $url, normalise_link($url), $ssl_url, $uid), array('limit' => 1));
$contact = dba::fetch($r);
dba::close($r);
}
$update_contact = ($contact['avatar-date'] < datetime_convert('', '', 'now -7 days'));
// We force the update if the avatar is empty
- if ($contact['avatar'] == '') {
+ if (!x($contact, 'avatar')) {
$update_contact = true;
}