From: SourceForge.net <no...@so...> - 2012-11-28 04:54:09
|
Bugs item #3243916, was opened at 2011-03-25 07:19 Message generated for change (Comment added) made by xzilla You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=3243916&group_id=37132 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Types Group: 5.0.1 Status: Open Resolution: None >Priority: 9 Private: No Submitted By: Leon P Smith (lpsmith) >Assigned to: Robert Treat (xzilla) Summary: bytea columns are mangled when displayed or exported Initial Comment: I'm using a bytea column to store sha-1 hashes in 24 bytes per hash. However, phpPgAdmin mangles these hashes when displaying them on a webpage or exporting them to a file. For example: $ psql psql (9.0.3) Type "help" for help. ali=> create table bytea_test (filename text, sha1hash bytea); CREATE TABLE ali=> insert into bytea_test values ali-> ( 'phpPgAdmin-5.0.2.tar.gz' ali(> , decode('908226ba8482a641172383d58823b171c05029a1','hex') ); INSERT 0 1 ali=> select * from bytea_test; filename | sha1hash -------------------------+-------------------------------------------- phpPgAdmin-5.0.2.tar.gz | \x908226ba8482a641172383d58823b171c05029a1 (1 row) However, phpPgAdmin displays sha1hash as \x903832323662613834383261363431313732333833643538383233623137316330353032396131 Which leaves \x90 unchanged, but everything else is replaced by the hexadecimal ascii character code of the hex digit. The problem is related to escapeBytea in classes/database/Postgres.php; either it is broken or it is being used inappropriately. My guess is the former. I've confirmed this issue with phpPgAdmin 4.2.3 and phpPgAdmin 5.0.2 on PHP 5.3.3-1ubuntu9.3 and PostgreSQL 9.0.3. It probably affects a much wider range of configurations, however. ---------------------------------------------------------------------- >Comment By: Robert Treat (xzilla) Date: 2012-11-27 20:54 Message: Hey, I've been working on this a bit the last few days, with plans to fix it in the next major version of PPA. PHP's bytea handling is pretty poor, so this has taken me longer than I had hoped. Your's is a good usecase to work from though, so thanks for the report. If there's any chance you came up with a fix, I'd love to hear about it, otherwise I'll update this ticket once I get things working. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=418980&aid=3243916&group_id=37132 |