[DBAL-490] [GH-303] Fixed a PHP warning in DBALException::driverExceptionDuringQuery() Created: 09/Apr/13  Updated: 01/May/13  Resolved: 01/May/13

Status: Resolved
Project: Doctrine DBAL
Component/s: None
Affects Version/s: None
Fix Version/s: 2.3.4
Security Level: All

Type: Bug Priority: Major
Reporter: Doctrine Bot Assignee: Benjamin Eberlei
Resolution: Fixed Votes: 0
Labels: None


This issue is created automatically through a Github pull request on behalf of BenMorel:

Url: https://github.com/doctrine/dbal/pull/303


When a query parameter contains binary data, `driverExceptionDuringQuery()` generates a PHP warning. This is because it internally uses `json_encode()`, which expects valid UTF-8 strings (at least in PHP 5.4.13).

This PR removes the warning with the `@` operator. `json_encode()` will still return a string representation, replacing the binary data with `null`.

I added a test that fails before the fix.

Comment by Doctrine Bot [ 01/May/13 ]

A related Github Pull-Request [GH-303] was closed:

Generated at Thu Oct 08 14:16:59 EDT 2015 using JIRA 6.4.10#64025-sha1:5b8b74079161cd76a20ab66dda52747ee6701bd6.