Aaron Schulz has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311092

Change subject: Avoid calling awful DatabaseBase::strictIPs() method
......................................................................

Avoid calling awful DatabaseBase::strictIPs() method

That method should be removed since it encourages incompatibility

Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e
---
M includes/changes/RecentChange.php
M includes/db/DatabaseMssql.php
2 files changed, 2 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/92/311092/1

diff --git a/includes/changes/RecentChange.php 
b/includes/changes/RecentChange.php
index 590fd37..ac5824b 100644
--- a/includes/changes/RecentChange.php
+++ b/includes/changes/RecentChange.php
@@ -297,7 +297,8 @@
                }
 
                # If our database is strict about IP addresses, use NULL 
instead of an empty string
-               if ( $dbw->strictIPs() && $this->mAttribs['rc_ip'] == '' ) {
+               $strictIPs = in_array( $dbw->getType(), [ 'oracle', 'postgres' 
] ); // legacy
+               if ( $strictIPs && $this->mAttribs['rc_ip'] == '' ) {
                        unset( $this->mAttribs['rc_ip'] );
                }
 
diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php
index 4ffafde..4875b48 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -50,10 +50,6 @@
                return false;
        }
 
-       public function strictIPs() {
-               return false;
-       }
-
        public function realTimestamps() {
                return false;
        }

-- 
To view, visit https://gerrit.wikimedia.org/r/311092
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <asch...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to