From 7e05dc6dcf2c847c1ce37df07ea6899b6b5a4eef Mon Sep 17 00:00:00 2001 From: chriskl Date: Wed, 18 Jun 2003 04:23:27 +0000 Subject: [PATCH] now that I understand addCSlashes, remove use of pg_escape_bytea in trigger list --- classes/database/Postgres.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index cece0ec7..98670d3e 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -4,7 +4,7 @@ * A class that implements the DB interface for Postgres * Note: This class uses ADODB and returns RecordSets. * - * $Id: Postgres.php,v 1.123 2003/06/17 00:41:26 chriskl Exp $ + * $Id: Postgres.php,v 1.124 2003/06/18 04:23:27 chriskl Exp $ */ // @@@ THOUGHT: What about inherits? ie. use of ONLY??? @@ -1868,10 +1868,10 @@ class Postgres extends BaseDB { $tgdef .= "EXECUTE PROCEDURE \"{$trigger['tgfname']}\"("; // Parameters - // Note: It was really hard to get this to work :( pg_escape_bytea is - // a bit of a hack, but the PHP functions don't seem to like the embedded nulls - // in the tgargs string... - $params = explode('\\\\000', pg_escape_bytea($trigger['tgargs'])); + // Escape null characters + $v = addCSlashes($trigger['tgargs'], "\0"); + // Split on escaped null characters + $params = explode('\\000', $v); for ($findx = 0; $findx < $trigger['tgnargs']; $findx++) { $param = "'" . str_replace('\'', '\\\'', $params[$findx]) . "'"; $tgdef .= $param; -- 2.39.5