]> git.mxchange.org Git - friendica-addons.git/blobdiff - diaspora/Diaspora_Connection.php
mathjax addon DE translation updated
[friendica-addons.git] / diaspora / Diaspora_Connection.php
index 8b8811ece5352c0f661aae6d0dc24b5ccaaeb618..a33bf608950f1ef8a4f9b6d546dc1d8d8103d595 100644 (file)
@@ -46,7 +46,11 @@ class Diaspora_Connection {
        public function setDiasporaID($id) {
                $parts = explode('@', $id);
                $this->user = $parts[0];
-               $this->host = $parts[1];
+               if (count($parts) > 1) {
+                       $this->host = $parts[1];
+               } else {
+                       $this->host = '';
+               }
        }
 
        public function getDiasporaID() {
@@ -136,7 +140,7 @@ class Diaspora_Connection {
                } elseif (!empty($m[1])) {
                        $token = $m[1];
                }
-               return (!empty($token)) ? $token : false;
+               return !empty($token) ? $token : false;
        }
 
        private function readJsonResponse($response) {
@@ -165,14 +169,14 @@ class Diaspora_Connection {
                $this->doHttpRequest('/bookmarklet');
                $m = [];
                preg_match('/"aspects"\:(\[.+?\])/', $this->last_http_result->response, $m);
-               return (!empty($m[1])) ? json_decode($m[1]) : false;
+               return !empty($m[1]) ? json_decode($m[1]) : false;
        }
 
        public function getServices() {
                $this->doHttpRequest('/bookmarklet');
                $m = [];
                preg_match('/"configured_services"\:(\[.+?\])/', $this->last_http_result->response, $m);
-               return (!empty($m[1])) ? json_decode($m[1]) : false;
+               return !empty($m[1]) ? json_decode($m[1]) : false;
        }
 
        public function getNotifications($notification_type = '', $show = '') {