r2973 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r2972‎ | r2973 | r2974 >
Date:04:02, 5 April 2004
Author:vibber
Status:old
Tags:
Comment:
Add $wgCapitalLinks option; if set to false, titles won't be forced to
have an initial capital. This isn't recommended in general, as it will
make "[[Asteroid]]s are..." and "... like [[asteroid]]s." point to
different pages.

It is meant mainly for languages which use the latin alphabet but don't
capitalize at sentence start (mainly conlangs) or for special purposes
where this is needed. This can *break links* and should not be changed
on an existing wiki without careful attention.
Modified paths:
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -580,7 +580,7 @@
581581 #
582582 /* private */ function secureAndSplit()
583583 {
584 - global $wgLang, $wgLocalInterwiki;
 584+ global $wgLang, $wgLocalInterwiki, $wgCapitalLinks;
585585 $fname = "Title::secureAndSplit";
586586 wfProfileIn( $fname );
587587
@@ -674,8 +674,10 @@
675675 }
676676
677677 # Initial capital letter
678 - if( $this->mInterwiki == "") $t = $wgLang->ucfirst( $r );
679 -
 678+ if( $wgCapitalLinks && $this->mInterwiki == "") {
 679+ $t = $wgLang->ucfirst( $r );
 680+ }
 681+
680682 # Fill fields
681683 $this->mDbkeyform = $t;
682684 $this->mUrlform = wfUrlencode( $t );
Index: trunk/phase3/includes/DefaultSettings.php
@@ -305,4 +305,12 @@
306306 $wgRightsPage = NULL;
307307 $wgRightsUrl = NULL;
308308 $wgRightsText = NULL;
 309+
 310+# Set this to false to avoid forcing the first letter of links
 311+# to capitals. WARNING: may break links! This makes links
 312+# COMPLETELY case-sensitive. Links appearing with a capital at
 313+# the beginning of a sentence will *not* go to the same place
 314+# as links in the middle of a sentence using a lowercase initial.
 315+$wgCapitalLinks = true;
 316+
309317 ?>

Status & tagging log