[phplib-dev] bug in db_pgsql.inc From: toby cabot (toby <email protected>)
Date: 06/30/00

Folks,

There's a small bug in db_pgsql.inc. The query method doesn't check for
null queries so it chokes during page open if you're using php4. The
mysql driver has a fix, so here's a patch that simply adds that code to
the pgsql driver:

--- phplib-7.2b/php/db_pgsql.inc Thu Mar 23 06:28:51 2000
+++ lib/phplib/db_pgsql.inc Thu Jun 29 17:40:36 2000
@@ -45,6 +47,14 @@
   }

   function query($Query_String) {
+ /* No empty queries, please, since PHP4 chokes on them. */
+ if ($Query_String == "")
+ /* The empty query string is passed on from the constructor,
+ * when calling the class without a query, e.g. in situations
+ * like these: '$db = new DB_Sql_Subclass;'
+ */
+ return 0;
+
     $this->connect();

 # printf("<br>Debug: query = %s<br>\n", $Query_String);

It should be pretty non-controversial since it brings the pgsql driver
more in sync with the mysql driver.

Thanks,
Toby

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-dev-unsubscribe <email protected>
For additional commands, e-mail: phplib-dev-help <email protected>