Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Fixes uninitialized string offset error #97

Merged
merged 1 commit into from
Nov 15, 2017

Conversation

weierophinney
Copy link
Member

As reported in #96, since #94 and the 1.3.1 release, if the body content for a PUT, PATCH, or DELETE call is empty, an "Uninitialized string offset: 0" notice is raised.

This patch does the following:

  • Adds tests missing from the original patch created for Assume content-type of application/json if not provided #94, verifying that JSON deserialization occurs for those HTTP methods if the content looks like JSON but no Content-Type header was present.
  • Adds tests demonstrating that empty content in those same situations will not result in an error, and a fix to the code to make that test pass.

As reported in zfcampus#96, since zfcampus#94 and the 1.3.1 release, if the body content
for a PUT, PATCH, or DELETE call is empty, an "Uninitialized string
offset: 0" notice is raised.

This patch adds tests missing from the original patch created for zfcampus#94,
verifying that JSON deserialization occurs for those HTTP methods if the
content looks like JSON but no Content-Type header was present. The new
cases also include scenarios where no content is present. A fix is
introduced to the `ContentTypeListener` to ensure the notice is no
longer raised.
@weierophinney weierophinney merged commit 649b679 into zfcampus:master Nov 15, 2017
weierophinney added a commit that referenced this pull request Nov 15, 2017
weierophinney added a commit that referenced this pull request Nov 15, 2017
weierophinney added a commit that referenced this pull request Nov 15, 2017
Forward port #97

Conflicts:
	CHANGELOG.md
@weierophinney weierophinney deleted the hotfix/96-empty-string branch November 15, 2017 17:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant