From: Aaron Schulz Date: Fri, 16 Sep 2016 05:44:49 +0000 (-0700) Subject: Avoid calling awful DatabaseBase::strictIPs() method X-Git-Tag: 1.31.0-rc.0~5477^2 X-Git-Url: http://git.cyclocoop.org/wiki/Target_page?a=commitdiff_plain;h=e5ee887448ce3accf1befe1ed80c2153019f2555;p=lhc%2Fweb%2Fwiklou.git Avoid calling awful DatabaseBase::strictIPs() method That method should be removed since it encourages incompatibility Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e --- diff --git a/includes/changes/RecentChange.php b/includes/changes/RecentChange.php index 590fd3704f..ac5824bbc8 100644 --- a/includes/changes/RecentChange.php +++ b/includes/changes/RecentChange.php @@ -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'] ); } diff --git a/includes/db/DatabaseMssql.php b/includes/db/DatabaseMssql.php index 339174e7bb..f2e6a67a67 100644 --- a/includes/db/DatabaseMssql.php +++ b/includes/db/DatabaseMssql.php @@ -50,7 +50,7 @@ class DatabaseMssql extends DatabaseBase { return false; } - public function strictIPs() { + public function realTimestamps() { return false; }