Add concept of "strict IPs" so we don't attempt to add "" as an IP address.
authorGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 16 Aug 2006 00:58:42 +0000 (00:58 +0000)
committerGreg Sabino Mullane <greg@users.mediawiki.org>
Wed, 16 Aug 2006 00:58:42 +0000 (00:58 +0000)
includes/Database.php
includes/DatabasePostgres.php

index 1acb83c..0c1d6df 100644 (file)
@@ -256,6 +256,7 @@ class Database {
        protected $mLBInfo = array();
        protected $mCascadingDeletes = false;
        protected $mCleanupTriggers = false;
+       protected $mStrictIPs = false;
 
 #------------------------------------------------------------------------------
 # Accessors
@@ -360,6 +361,14 @@ class Database {
                return $this->mCleanupTriggers;
        }
 
+       /**
+        * Returns true if this database is strict about what can be put into an IP field.
+        * Specifically, it uses a NULL value instead of an empty string.
+        */
+       function strictIPs() {
+               return $this->mStrictIPs;
+       }
+
        /**#@+
         * Get function
         */
index 707c8d8..f1119c7 100644 (file)
@@ -32,6 +32,7 @@ class DatabasePostgres extends Database {
                $this->mFailFunction = $failFunction;
                $this->mCascadingDeletes = true;
                $this->mCleanupTriggers = true;
+               $this->mStrictIPs = true;
                $this->mFlags = $flags;
                $this->open( $server, $user, $password, $dbName);