diff --git a/mod/cal.php b/mod/cal.php index a4c26eed3..7796a459d 100644 --- a/mod/cal.php +++ b/mod/cal.php @@ -46,7 +46,7 @@ function cal_init(App $a) // if it's a json request abort here becaus we don't // need the widget data - if ($a->argv[2] === 'json') { + if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) { return; } @@ -194,7 +194,7 @@ function cal_content(App $a) $finish = sprintf('%d-%d-%d %d:%d:%d', $y, $m, $dim, 23, 59, 59); - if ($a->argv[2] === 'json') { + if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) { if (x($_GET, 'start')) { $start = $_GET['start']; } @@ -242,7 +242,7 @@ function cal_content(App $a) // transform the event in a usable array $events = Event::prepareListForTemplate($r); - if ($a->argv[2] === 'json') { + if (!empty($a->argv[2]) && ($a->argv[2] === 'json')) { echo json_encode($events); killme(); } diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index a1fe4f306..0c05b0108 100644 --- a/src/Content/OEmbed.php +++ b/src/Content/OEmbed.php @@ -152,7 +152,7 @@ class OEmbed $oembed->description = $data['text']; } - if (is_array($data['images'])) { + if (!empty($data['images'])) { $oembed->thumbnail_url = $data['images'][0]['src']; $oembed->thumbnail_width = $data['images'][0]['width']; $oembed->thumbnail_height = $data['images'][0]['height']; diff --git a/src/Model/PermissionSet.php b/src/Model/PermissionSet.php index cbbde2ae0..6506c7094 100644 --- a/src/Model/PermissionSet.php +++ b/src/Model/PermissionSet.php @@ -102,7 +102,6 @@ class PermissionSet extends BaseObject $set[] = $permission['id']; } DBA::close($ret); - logger('Blubb: '.$uid.' - '.$contact_id.': '.implode(', ', $set)); return $set; } diff --git a/src/Model/Profile.php b/src/Model/Profile.php index 15ad83ed8..5180a3ea2 100644 --- a/src/Model/Profile.php +++ b/src/Model/Profile.php @@ -116,6 +116,10 @@ class Profile return; } + if (empty($pdata)) { + $pdata = ['uid' => 0, 'profile_uid' => 0, 'is-default' => false,'name' => $nickname]; + } + // fetch user tags if this isn't the default profile if (!$pdata['is-default']) {