Skip to content

Conversation

@snapshotpl
Copy link
Contributor

@snapshotpl snapshotpl force-pushed the fix-deprecation-error branch from 8cbc0d5 to 944bdb3 Compare May 31, 2022 12:44
@snapshotpl
Copy link
Contributor Author

@bshaffer Can you look at?

Copy link
Owner

@bshaffer bshaffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@snapshotpl this is causing the tests to fail. that is because there is a $contentType !== null check a few lines below your change which is now failing when it should succeed. The better solution would be to cast $contentType to a string when calling strpos


$contentType = $request->server('CONTENT_TYPE');
$contentType = $request->server('CONTENT_TYPE', '');
if (false !== $pos = strpos($contentType, ';')) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (false !== $pos = strpos($contentType, ';')) {
if (false !== $pos = strpos((string) $contentType, ';')) {

}

$contentType = $request->server('CONTENT_TYPE');
$contentType = $request->server('CONTENT_TYPE', '');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$contentType = $request->server('CONTENT_TYPE', '');
$contentType = $request->server('CONTENT_TYPE');

@snapshotpl snapshotpl force-pushed the fix-deprecation-error branch from 944bdb3 to b7e2bdf Compare May 31, 2022 15:35
@snapshotpl snapshotpl requested a review from bshaffer May 31, 2022 15:35
@bshaffer bshaffer merged commit 2bfaf9d into bshaffer:master May 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants