From c978cee8562f018dab158b41e15266fcf873bf1b Mon Sep 17 00:00:00 2001 From: tisane Date: Fri, 15 Nov 2013 23:49:29 -0500 Subject: [PATCH] Set $wgNoFollowLinks to false iff "Authorized editors only" selected Adds a little more whitespace for other configs; let me know if that's not okay Bug: 57115 Change-Id: I27775195a1a69cc83c2ea24640e563095591aff7 --- includes/installer/LocalSettingsGenerator.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/includes/installer/LocalSettingsGenerator.php b/includes/installer/LocalSettingsGenerator.php index 56d8353758..49fbfe4f93 100644 --- a/includes/installer/LocalSettingsGenerator.php +++ b/includes/installer/LocalSettingsGenerator.php @@ -220,6 +220,17 @@ class LocalSettingsGenerator { wfBoolToStr( $perm ) . ";\n"; } } + $noFollow = ''; + if ( $this->groupPermissions['*']['edit'] === false + && $this->groupPermissions['*']['createaccount'] === false + && $this->groupPermissions['*']['read'] !== false ) { + $noFollow = "# Set \$wgNoFollowLinks to true if you open up your wiki to editing by\n" + . "# the general public and wish to apply nofollow to external links as a\n" + . "# deterrent to spammers. Nofollow is not a comprehensive anti-spam solution\n" + . "# and open wikis will generally require other anti-spam measures; for more\n" + . "# information, see https://www.mediawiki.org/wiki/Manual:Combating_spam\n" + . "\$wgNoFollowLinks = false;"; + } } $wgServerSetting = ""; @@ -353,6 +364,7 @@ ${wgServerSetting} # Path to the GNU diff3 utility. Used for conflict resolution. \$wgDiff3 = \"{$this->values['wgDiff3']}\"; -{$groupRights}"; +{$groupRights} +{$noFollow}"; } } -- 2.20.1