r104983 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104982‎ | r104983 | r104984 >
Date:18:04, 2 December 2011
Author:cervidae
Status:deferred
Tags:
Comment:
protect help pages by language code
Modified paths:
  • /trunk/extensions/HelpCommons/HelpCommons.php (modified) (history)

Diff [purge]

Index: trunk/extensions/HelpCommons/HelpCommons.php
@@ -202,15 +202,15 @@
203203 * @param $result
204204 * @return bool
205205 */
206 -function fnProtectHelpCommons( &$title, &$user, $action, &$result) {
207 - global $wgHelpCommonsFetchingWikis, $wgDBname;
 206+function fnProtectHelpCommons( &$title, &$user, $action, &$result ) {
 207+ global $wgHelpCommonsFetchingWikis, $wgLanguageCode, $wgDBname;
208208
209 - foreach ( $wgHelpCommonsFetchingWikis as $urls ) {
 209+ foreach ( $wgHelpCommonsFetchingWikis as $language => $urls ) {
210210 foreach ( $urls as $url => $helpwiki ) {
211211 // only protect Help pages on non-help-pages-fetching wikis
212 - if( $wgDBname != $helpwiki ) {
 212+ if ( $wgLanguageCode == "$language" && $wgDBname != $helpwiki ) {
213213 // block actions 'edit' and 'create'
214 - if( $action != 'edit' && $action != 'create' ) {
 214+ if ( $action != 'edit' && $action != 'create' ) {
215215 return true;
216216 }
217217

Follow-up revisions

RevisionCommit summaryAuthorDate
r105126using constant without function, per Nikerabbit, r104965cervidae20:19, 4 December 2011

Status & tagging log