From:             skrald at amossen dot dk
Operating system: Linux
PHP version:      5.2.6
PHP Bug Type:     PostgreSQL related
Bug description:  pg_unescape_bytea() does not unescape correctly

Description:
------------
Calling pg_unescape_bytea() on some data that has been escaped with
pg_escape_bytea() does not produce the original data as expected. That is:
the "unescape" method is not the opposite of the "escape" method.


Reproduce code:
---------------
<?php
$data = file_get_contents("/path/to/binary/file");
$esc = pg_escape_bytea($data);
$unesc = pg_unescape_bytea($esc);

print($unesc == $data ? "equal" : "different");
?>


Expected result:
----------------
"equal"



Actual result:
--------------
"different"

-- 
Edit bug report at http://bugs.php.net/?id=45964&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45964&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45964&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45964&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45964&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45964&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45964&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45964&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45964&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45964&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45964&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45964&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45964&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45964&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45964&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45964&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45964&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45964&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45964&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45964&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45964&r=mysqlcfg

Reply via email to