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() {
} elseif (!empty($m[1])) {
$token = $m[1];
}
- return (!empty($token)) ? $token : false;
+ return !empty($token) ? $token : false;
}
private function readJsonResponse($response) {
$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 = '') {