Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #51: Improve "unsupported version" message in unserialization #89

Merged
merged 1 commit into from Oct 30, 2016

Conversation

TysonAndre
Copy link
Member

  1. If all of the characters are printable ASCII,
    then print a different error
    message as a warning (Print the string representation instead of the
    little endian representation).
    This makes it more obvious if JSON, php, etc. serialization
    formats are incorrectly passed in.
    This adds appropriate backslashes.
  2. If there are 1-4 bytes in the string,
    there previously wasn't a php warning, but this returned false.
    Emit one. (The smallest total serialized data length is (4+1) for things such as igbinary_serialize(null): "\x00\x00\x00\x02\x00")
    (This continues to not emit a warning for false or the empty string)

@TysonAndre TysonAndre force-pushed the unsupported_version-warning-reword branch from 88ee8fa to e302c09 Compare October 27, 2016 05:53
@TysonAndre TysonAndre mentioned this pull request Oct 27, 2016
(When unserializing the 4-byte binary header)

1. If all of the characters are printable ASCII,
   then print a different error
   message as a warning (Print the string representation instead of the
   little endian representation).
   This makes it more obvious if JSON, php, etc. serialization
   formats are incorrectly passed in.
2. If there are 1-4 bytes in the string,
   there previously wasn't a php warning, but this failed and returned null.
   Emit a warning.
   (This continues to emit no warnings when false or the empty string are
   passed in)
3. Add comment to warning if version appears to have incorrect endianness
   (i.e. 0th byte set instead of 3rd byte)
@TysonAndre TysonAndre force-pushed the unsupported_version-warning-reword branch from e302c09 to d59af13 Compare October 28, 2016 03:32
@TysonAndre
Copy link
Member Author

@phadej

@TysonAndre TysonAndre merged commit 9d8ad7a into master Oct 30, 2016
@TysonAndre TysonAndre deleted the unsupported_version-warning-reword branch November 8, 2016 04:33
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.

None yet

1 participant