Add $wgCapitalLinks option; if set to false, titles won't be forced to
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Apr 2004 04:02:04 +0000 (04:02 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Apr 2004 04:02:04 +0000 (04:02 +0000)
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.

includes/DefaultSettings.php
includes/Title.php

index d731b01..143b749 100644 (file)
@@ -305,4 +305,12 @@ $wgEnableCreativeCommonsRdf = false;
 $wgRightsPage = NULL;
 $wgRightsUrl = NULL;
 $wgRightsText = NULL;
+
+# Set this to false to avoid forcing the first letter of links
+# to capitals. WARNING: may break links! This makes links
+# COMPLETELY case-sensitive. Links appearing with a capital at
+# the beginning of a sentence will *not* go to the same place
+# as links in the middle of a sentence using a lowercase initial.
+$wgCapitalLinks = true;
+
 ?>
index b5f2a6e..a5a8015 100644 (file)
@@ -580,7 +580,7 @@ class Title {
        #
        /* private */ function secureAndSplit()
        {
-               global $wgLang, $wgLocalInterwiki;
+               global $wgLang, $wgLocalInterwiki, $wgCapitalLinks;
                $fname = "Title::secureAndSplit";
                wfProfileIn( $fname );
                
@@ -674,8 +674,10 @@ class Title {
                }
 
                # Initial capital letter
-               if( $this->mInterwiki == "") $t = $wgLang->ucfirst( $r );
-
+               if( $wgCapitalLinks && $this->mInterwiki == "") {
+                       $t = $wgLang->ucfirst( $r );
+               }
+               
                # Fill fields
                $this->mDbkeyform = $t;
                $this->mUrlform = wfUrlencode( $t );