[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid calling awful DatabaseBase::strictIPs() method

2016-09-19 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

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, 3 insertions(+), 2 deletions(-)

Approvals:
  Catrope: Looks good to me, approved
  jenkins-bot: Verified



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 339174e..f2e6a67 100644
--- a/includes/db/DatabaseMssql.php
+++ b/includes/db/DatabaseMssql.php
@@ -50,7 +50,7 @@
return false;
}
 
-   public function strictIPs() {
+   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: merged
Gerrit-Change-Id: Id8a0174266bcd988c85943507f1edb3518fe087e
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz 
Gerrit-Reviewer: Catrope 
Gerrit-Reviewer: Parent5446 
Gerrit-Reviewer: Skizzerz 
Gerrit-Reviewer: Smalyshev 
Gerrit-Reviewer: jenkins-bot <>

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


[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Avoid calling awful DatabaseBase::strictIPs() method

2016-09-15 Thread Aaron Schulz (Code Review)
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 

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