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

Stop TracedStatement throwing warnings for objects #393

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AnthonyPorthouse
Copy link

The current behaviour of TracedStatement::checkParameters() will cause warnings to be raised when objects are passed in as a parameter. This should not always be the case.

This PR adds support for both objects with and without __toString() methods.

If an object has a __toString() method, then we will call that and use that as our parameter.

If it does not, then we will short circuit the encoding check and just make it show up as [BINARY DATA].

Another option, which is preferred would be to add another possible value such as [OBJECT classname] which would differentiate it from standard binary data.

When objects are passed in as SQL parameters if they are able to be cast
to string then we should do so.

If we cannot cast them to string we will short circuit the mb_check_encoding
test so that we never try to use any objects as a parameter of that
function.
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.

1 participant