From cae1350eb23868410037d5025d9cf8a184b9e80d Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Wed, 16 Aug 2006 00:58:42 +0000 Subject: [PATCH] Add concept of "strict IPs" so we don't attempt to add "" as an IP address. --- includes/Database.php | 9 +++++++++ includes/DatabasePostgres.php | 1 + 2 files changed, 10 insertions(+) diff --git a/includes/Database.php b/includes/Database.php index 1acb83cd35..0c1d6dfaf7 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -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 */ diff --git a/includes/DatabasePostgres.php b/includes/DatabasePostgres.php index 707c8d8e31..f1119c7dd4 100644 --- a/includes/DatabasePostgres.php +++ b/includes/DatabasePostgres.php @@ -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); -- 2.20.1