]> git.mxchange.org Git - friendica.git/blobdiff - mod/salmon.php
Fix function naming
[friendica.git] / mod / salmon.php
index 8bdfdefeee1663ba2d9c72bd3644f7848787dda0..bd4b3773cb7a4de2a81d1618115f9f885d177226 100644 (file)
@@ -41,14 +41,14 @@ function salmon_post(App $a, $xml = '') {
        $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);
        }
@@ -153,11 +153,14 @@ function salmon_post(App $a, $xml = '') {
                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(Protocol::OSTATUS),