Skip to content

Commit fb5a7cd

Browse files
authored
Merge pull request #317 from binaryfire/fix/operator-precedence-bugs
fix: operator precedence bugs and PSR-7 getHeader usage
2 parents dc2f6cc + 92568df commit fb5a7cd

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/filesystem/src/FilesystemManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ function (&$parent) use ($config) {
379379
*/
380380
protected function createFlysystem(FlysystemAdapter $adapter, array $config): FilesystemOperator
381381
{
382-
if ($config['read-only'] ?? false === true) {
382+
if (($config['read-only'] ?? false) === true) {
383383
/* @phpstan-ignore-next-line */
384384
$adapter = new ReadOnlyFilesystemAdapter($adapter);
385385
}

src/foundation/src/Testing/TestResponseAssert.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public static function __callStatic(string $name, array $arguments): void
6161
*/
6262
protected function injectResponseContext(ExpectationFailedException $exception): ExpectationFailedException
6363
{
64-
if ($this->response->getHeader('Content-Type') === 'application/json') {
64+
if (str_contains($this->response->getHeader('Content-Type')[0] ?? '', 'application/json')) {
6565
$testJson = new AssertableJsonString($this->response->getContent());
6666

6767
if (isset($testJson['errors'])) {

src/session/src/Middleware/StartSession.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ protected function configHitsLottery(array $config): bool
158158
protected function storeCurrentUrl(Session $session): void
159159
{
160160
if ($this->request->isMethod('GET')
161-
&& ! $this->request->header('X-Requested-With') === 'XMLHttpRequest' // is not ajax
161+
&& $this->request->header('X-Requested-With') !== 'XMLHttpRequest' // is not ajax
162162
&& ! $this->isPrefetch()
163163
) {
164164
$session->setPreviousUrl($this->request->fullUrl());

0 commit comments

Comments
 (0)