From bc384208016abd2e4ec04dee1f9c6ffd5ced90d2 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 29 Jul 2018 04:04:23 +0000 Subject: [PATCH 1/3] Some more notices removed --- src/Content/OEmbed.php | 2 +- src/Model/Profile.php | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Content/OEmbed.php b/src/Content/OEmbed.php index a1fe4f3064..0c05b01086 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/Profile.php b/src/Model/Profile.php index 15ad83ed85..5180a3ea2e 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']) { From 6add589c3fc9f1a6fb8f38656e94c53ac6d613b4 Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 29 Jul 2018 04:38:14 +0000 Subject: [PATCH 2/3] Removed some test logging --- src/Model/PermissionSet.php | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Model/PermissionSet.php b/src/Model/PermissionSet.php index cbbde2ae0a..6506c70940 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; } From dc30daf3a2d8f04efa6a18d4fea8e976209ce00d Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 29 Jul 2018 06:08:02 +0000 Subject: [PATCH 3/3] And another notice removed --- mod/cal.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mod/cal.php b/mod/cal.php index a4c26eed3a..7796a459d0 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(); }