You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I asked a question on StackOverflow and from the various responses it appears that perhaps this is a bug in the pdo_sqlsrv driver itself. I am therefore re-posting it here so that it can be investigated properly.
I'm trying to insert ASCII NUL characters (\0 aka U+0000) into an SQL Server database from PHP, using pdo_sqlsrv. This is a requirement for handling PHP serialized strings, which contain NUL characters to represent private/protected variables.
However, there is something about PDO::quote() which is breaking the strings.
Code to reproduce (replace DBNAME, USERNAME and PASSWORD with appropriate values):
Note that it appears that the final character is random, as on a subsequent run it was an e. This implies some form of memory access error, e.g. reading past the end of the string. Maybe a bug in the pdo_sqlsrv implementation?
The text was updated successfully, but these errors were encountered:
I asked a question on StackOverflow and from the various responses it appears that perhaps this is a bug in the pdo_sqlsrv driver itself. I am therefore re-posting it here so that it can be investigated properly.
Here is the same question as posted on StackOverflow: https://stackoverflow.com/questions/46100518
I'm trying to insert ASCII NUL characters (
\0
akaU+0000
) into an SQL Server database from PHP, using pdo_sqlsrv. This is a requirement for handling PHP serialized strings, which contain NUL characters to represent private/protected variables.However, there is something about PDO::quote() which is breaking the strings.
Code to reproduce (replace
DBNAME
,USERNAME
andPASSWORD
with appropriate values):Expected Output:
Actual Output:
Note that it appears that the final character is random, as on a subsequent run it was an
e
. This implies some form of memory access error, e.g. reading past the end of the string. Maybe a bug in the pdo_sqlsrv implementation?The text was updated successfully, but these errors were encountered: