[MediaWiki-commits] [Gerrit] mediawiki...CheckUser[master]: Use the ProxyLookup service if possible
jenkins-bot has submitted this change and it was merged. Change subject: Use the ProxyLookup service if possible .. Use the ProxyLookup service if possible Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 --- M CheckUser.hooks.php 1 file changed, 11 insertions(+), 1 deletion(-) Approvals: Aaron Schulz: Looks good to me, approved jenkins-bot: Verified diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php index 9c812d4..4797c99 100755 --- a/CheckUser.hooks.php +++ b/CheckUser.hooks.php @@ -1,4 +1,7 @@ getProxyLookup(); + } else { + // This is kind of sketch, but is good enough for back-compat + $proxyLookup = new IP(); + } + $client = null; // best guess of the client IP $isSquidOnly = false; // all proxy servers where site Squid/Varnish servers? # Step through XFF list and find the last address in the list which is a @@ -308,7 +318,7 @@ if ( $curIP === null ) { break; // not a valid IP address } - $curIsSquid = IP::isConfiguredProxy( $curIP ); + $curIsSquid = $proxyLookup->isConfiguredProxy( $curIP ); if ( $client === null ) { $client = $curIP; $isSquidOnly = $curIsSquid; -- To view, visit https://gerrit.wikimedia.org/r/312161 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/CheckUser Gerrit-Branch: master Gerrit-Owner: LegoktmGerrit-Reviewer: Aaron Schulz 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...CheckUser[master]: Use the ProxyLookup service if possible
Legoktm has uploaded a new change for review. https://gerrit.wikimedia.org/r/312161 Change subject: Use the ProxyLookup service if possible .. Use the ProxyLookup service if possible Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 --- M CheckUser.hooks.php 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CheckUser refs/changes/61/312161/1 diff --git a/CheckUser.hooks.php b/CheckUser.hooks.php index 9c812d4..b85610d 100755 --- a/CheckUser.hooks.php +++ b/CheckUser.hooks.php @@ -1,4 +1,7 @@ getProxyLookup(), 'isConfiguredProxy' ]; + } else { + $isConfigured = [ IP::class, 'isConfiguredProxy' ]; + } + $client = null; // best guess of the client IP $isSquidOnly = false; // all proxy servers where site Squid/Varnish servers? # Step through XFF list and find the last address in the list which is a @@ -308,7 +317,7 @@ if ( $curIP === null ) { break; // not a valid IP address } - $curIsSquid = IP::isConfiguredProxy( $curIP ); + $curIsSquid = call_user_func( $isConfigured, $curIP ); if ( $client === null ) { $client = $curIP; $isSquidOnly = $curIsSquid; -- To view, visit https://gerrit.wikimedia.org/r/312161 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic2b585834887364cbf08e4fca3bb8e9a96630207 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/CheckUser Gerrit-Branch: master Gerrit-Owner: Legoktm___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits