Avoid calling awful DatabaseBase::strictIPs() method
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 16 Sep 2016 05:44:49 +0000 (22:44 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 18 Sep 2016 02:21:53 +0000 (19:21 -0700)
That method should be removed since it encourages incompatibility

Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e

includes/changes/RecentChange.php
includes/db/DatabaseMssql.php

index 590fd37..ac5824b 100644 (file)
@@ -297,7 +297,8 @@ class RecentChange {
                }
 
                # 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'] );
                }
 
index 339174e..f2e6a67 100644 (file)
@@ -50,7 +50,7 @@ class DatabaseMssql extends DatabaseBase {
                return false;
        }
 
-       public function strictIPs() {
+       public function realTimestamps() {
                return false;
        }