From c6b74e2775a6de4797aa73350650c831bb0ecbdd Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 16 Aug 2019 10:31:31 -0400 Subject: [PATCH] Minor code cleanup, add newer php version for travis tests --- .travis.yml | 2 ++ src/Controller.php | 4 ++-- src/Model/API.php | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 38328d45..4a25e07f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ install: php: - 7.1 - 7.2 + - 7.3 + - 7.4 - hhvm - nightly diff --git a/src/Controller.php b/src/Controller.php index 6f0d7b44..e76784d5 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -154,7 +154,7 @@ class Controller { if (null === $url) { $url = $util->isViewPage() - ? $this->request->getUri()->__toString() + ? (string) $this->request->getUri() : $serverParams['HTTP_REFERER']; } @@ -245,7 +245,7 @@ class Controller { $csp = [ "default-src 'self'", "object-src 'none'", - "frame-src *.youtube.com", + 'frame-src *.youtube.com', ]; $view->addHeader('Content-Security-Policy', implode('; ', $csp)); diff --git a/src/Model/API.php b/src/Model/API.php index a411b7ae..ebc7c06c 100644 --- a/src/Model/API.php +++ b/src/Model/API.php @@ -44,7 +44,7 @@ class API { array_multisort($sort, SORT_ASC, $array); // Re-key array items by their ids - if (array_key_exists('id', $array[0])) + if (array_key_exists('id', (array)$array[0])) { $keyed = [];