*/
use Friendica\App;
use Friendica\Core\PConfig;
+use Friendica\Core\Protocol;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\Model\Contact;
$base = null;
// figure out where in the DOM tree our data is hiding
- if($dom->provenance->data)
+ if (!empty($dom->provenance->data))
$base = $dom->provenance;
- elseif($dom->env->data)
+ elseif (!empty($dom->env->data))
$base = $dom->env;
- elseif($dom->data)
+ elseif (!empty($dom->data))
$base = $dom;
- if(! $base) {
+ if (empty($base)) {
logger('unable to locate salmon data in xml ');
System::httpExit(400);
}
$r = q("SELECT * FROM `contact` WHERE `network` IN ('%s', '%s')
AND (`nurl` = '%s' OR `alias` = '%s' OR `alias` = '%s')
AND `uid` = %d LIMIT 1",
- DBA::escape(NETWORK_OSTATUS),
- DBA::escape(NETWORK_DFRN),
+ DBA::escape(Protocol::OSTATUS),
+ DBA::escape(Protocol::DFRN),
DBA::escape(normalise_link($author_link)),
DBA::escape($author_link),
DBA::escape(normalise_link($author_link)),
intval($importer['uid'])
);
- if (! DBA::isResult($r)) {
+
+ if (!DBA::isResult($r)) {
logger('Author ' . $author_link . ' unknown to user ' . $importer['uid'] . '.');
- if(PConfig::get($importer['uid'],'system','ostatus_autofriend')) {
+
+ if (PConfig::get($importer['uid'], 'system', 'ostatus_autofriend')) {
$result = Contact::createFromProbe($importer['uid'], $author_link);
- if($result['success']) {
+
+ if ($result['success']) {
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
AND `uid` = %d LIMIT 1",
- DBA::escape(NETWORK_OSTATUS),
+ DBA::escape(Protocol::OSTATUS),
DBA::escape($author_link),
DBA::escape($author_link),
intval($importer['uid'])
// Have we ignored the person?
// If so we can not accept this post.
- //if((DBA::isResult($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == CONTACT_IS_FOLLOWER) || ($r[0]['blocked']))) {
+ //if((DBA::isResult($r)) && (($r[0]['readonly']) || ($r[0]['rel'] == Contact::FOLLOWER) || ($r[0]['blocked']))) {
if (DBA::isResult($r) && $r[0]['blocked']) {
logger('Ignoring this author.');
System::httpExit(202);