From 90a0b39e11822d0cd67fc0b4bb86c9a25c79c649 Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sat, 27 Aug 2016 00:50:07 +0200 Subject: [PATCH] fix undefined offset warning --- controller/rest/publiccontroller.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/controller/rest/publiccontroller.php b/controller/rest/publiccontroller.php index 917c2c02..c644d174 100644 --- a/controller/rest/publiccontroller.php +++ b/controller/rest/publiccontroller.php @@ -43,8 +43,12 @@ class PublicController extends ApiController { return $this->newJsonErrorMessage("User could not be identified"); } - if ($tags[0] == "") { - $tags = array(); + if (!is_array($tags)) { + if(is_string($tags) && $tags !== '') { + $tags = [ $tags ]; + } else { + $tags = array(); + } } $public = true;