Fix a bug where cleaning a table name containing quotes makes hasObjectID works on...
authorGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 1 Apr 2009 02:57:51 +0000 (22:57 -0400)
committerGuillaume (ioguix) de Rorthais <ioguix@free.fr>
Wed, 1 Apr 2009 02:57:51 +0000 (22:57 -0400)
Fix hasObjectID to return null on error instead of -99 that is considered as true in php.

classes/database/Postgres.php

index a7707680a34b4d4ce2aeade92f91ae586017422e..a0a3c372d50fbf2465ab0d7317ffd8b8e67e4a58 100755 (executable)
@@ -7146,7 +7146,6 @@ class Postgres extends ADODB_base {
         * @return The SQL query
         */
        function getSelectSQL($table, $show, $values, $ops, $orderby = array()) {
-               $this->fieldClean($table);
                $this->fieldArrayClean($show);
 
                // If an empty array is passed in, then show all columns
@@ -7166,6 +7165,8 @@ class Postgres extends ADODB_base {
                        $sql .= join('","', $show) . "\" FROM ";
                }
 
+               $this->fieldClean($table);
+
                if (isset($_REQUEST['schema'])) {
                        $this->fieldClean($_REQUEST['schema']);
                        $sql .= "\"{$_REQUEST['schema']}\".";