php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38403 unable to quote \0 to sql strings
Submitted: 2006-08-09 21:05 UTC Modified: 2006-08-10 17:18 UTC
From: neta at abcb dot it Assigned:
Status: Not a bug Package: PDO related
PHP Version: 5.1.4 OS: OSX/NetBSD/FreeBSD
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: neta at abcb dot it
New email:
PHP Version: OS:

 

 [2006-08-09 21:05 UTC] neta at abcb dot it
Description:
------------
Sending TEXT data to PostgreSQL a database, the string gets 
truncated at the first occurrence of \0.

Reproduce code:
---------------
Just try to INSERT "abc\0def" into a TEXT field.

Expected result:
----------------
'abc'


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-10 16:53 UTC] tony2001@php.net
Use PDO::quote() to quote binary data before inserting it to the DB.
 [2006-08-10 17:18 UTC] neta at abcb dot it
update: i just realized that libpq's PQescapeString() *cannot* 
handle \0 in the middle of a string.

This is not PDO's fault.

My apologies.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 19:01:28 2024 UTC