From 9a0a2c0e91769ed0f0b9cee8f4202b7e8abf9eaa Mon Sep 17 00:00:00 2001 From: Andrew McMillan Date: Mon, 22 Mar 2010 17:00:42 -0700 Subject: [PATCH] OK, finally nailed the quoting of wierd strings issue. --- inc/AwlDBDialect.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/inc/AwlDBDialect.php b/inc/AwlDBDialect.php index 059655eb..e5027923 100644 --- a/inc/AwlDBDialect.php +++ b/inc/AwlDBDialect.php @@ -227,12 +227,11 @@ class AwlDBDialect { $rv = $value; break; case PDO::PARAM_BOOL: - $rv = $value ? 'TRUE' : 'FALSE'; + $rv = ($value ? 'TRUE' : 'FALSE'); break; case PDO::PARAM_STR: default: - $rv = str_replace("'", "''", $value); - $rv = "'".str_replace('\\', '\\\\\\', $rv)."'"; + $rv = "'".str_replace("'", "''", str_replace('\\', '\\x5c', $value))."'"; if ( $this->dialect == 'pgsql' && strpos( $rv, '\\' ) !== false ) { /** PostgreSQL wants to know when a string might contain escapes */