Page MenuHomePhabricator

mediawiki-1.15.0rc1-anonymize-v2.patch

Authored By
bzimport
Nov 21 2014, 10:42 PM
Size
1 KB
Referenced Files
None
Subscribers
None

mediawiki-1.15.0rc1-anonymize-v2.patch

diff -Naur mediawiki-1.15.0rc1/includes/DefaultSettings.php mediawiki-1.15.0rc1-1/includes/DefaultSettings.php
--- mediawiki-1.15.0rc1/includes/DefaultSettings.php 2009-05-01 06:29:52.000000000 +0200
+++ mediawiki-1.15.0rc1-1/includes/DefaultSettings.php 2009-05-28 10:27:30.000000000 +0200
@@ -3791,3 +3791,10 @@
* modify the user rights of those users via Special:UserRights
*/
$wgUserrightsInterwikiDelimiter = '@';
+
+/**
+ * Allows anonymous editing. By default, MediaWiki will save the IP adress of
+ * anonymous edits, with this option disabled, this is replaced by 0.0.0.0.
+ */
+$wgSaveIPs = true;
+
diff -Naur mediawiki-1.15.0rc1/includes/ProxyTools.php mediawiki-1.15.0rc1-1/includes/ProxyTools.php
--- mediawiki-1.15.0rc1/includes/ProxyTools.php 2008-12-10 23:58:24.000000000 +0100
+++ mediawiki-1.15.0rc1-1/includes/ProxyTools.php 2009-05-28 10:27:30.000000000 +0200
@@ -67,7 +67,7 @@
* @return string
*/
function wfGetIP() {
- global $wgIP, $wgUsePrivateIPs;
+ global $wgIP, $wgUsePrivateIPs, $wgSaveIPs;
# Return cached result
if ( !empty( $wgIP ) ) {
@@ -76,7 +76,9 @@
/* collect the originating ips */
# Client connecting to this webserver
- if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
+ if ( ! $wgSaveIPs ) {
+ $ipchain = array( '0.0.0.0' );
+ } else if ( isset( $_SERVER['REMOTE_ADDR'] ) ) {
$ipchain = array( IP::canonicalize( $_SERVER['REMOTE_ADDR'] ) );
} else {
# Running on CLI?

File Metadata

Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5394
Default Alt Text
mediawiki-1.15.0rc1-anonymize-v2.patch (1 KB)

Event Timeline