+
+ /**
+ * Is the namespace first-letter capitalized?
+ *
+ * @param $index int Index to check
+ * @return bool
+ */
+ public static function isCapitalized( $index ) {
+ global $wgCapitalLinks, $wgCapitalLinkOverrides;
+ // Turn NS_MEDIA into NS_FILE
+ $index = $index === NS_MEDIA ? NS_FILE : $index;
+
+ // Make sure to get the subject of our namespace
+ $index = self::getSubject( $index );
+
+ // Some namespaces are special and should always be upper case
+ if ( in_array( $index, self::$alwaysCapitalizedNamespaces ) ) {
+ return true;
+ }
+ if ( isset( $wgCapitalLinkOverrides[ $index ] ) ) {
+ // $wgCapitalLinkOverrides is explicitly set
+ return $wgCapitalLinkOverrides[ $index ];
+ }
+ // Default to the global setting
+ return $wgCapitalLinks;
+ }