diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 93f03503c..04eaab588 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-24.04 strategy: matrix: - php-versions: ['8.1', '8.2', '8.3', '8.4'] + php-versions: ['8.1', '8.2', '8.3', '8.4', '8.5'] fail-fast: false steps: - name: Checkout diff --git a/application/src/View/Strategy/ApiJsonStrategy.php b/application/src/View/Strategy/ApiJsonStrategy.php index 82dac0923..f9daca20f 100644 --- a/application/src/View/Strategy/ApiJsonStrategy.php +++ b/application/src/View/Strategy/ApiJsonStrategy.php @@ -139,9 +139,10 @@ protected function getFormat(ApiJsonModel $model) $this->formats = $args['formats']; // Prioritize the "format" query parameter. - $format = $model->getOption('format'); - if (array_key_exists($format, $this->formats)) { - return $format; + if ($format = $model->getOption('format')) { + if (array_key_exists($format, $this->formats)) { + return $format; + } } // Respect the Accept header for content negotiation. $acceptHeader = $model->getOption('accept_header');