From efdffb2bcaf0b09c4e3d437cae818368b23b0fbc Mon Sep 17 00:00:00 2001
From: Brion Vibber
Date: Tue, 9 Jan 2007 00:00:56 +0000
Subject: [PATCH] Fix regression in use of messages with underscores/spaces;
normalize spaces to underscores for loading
---
includes/MessageCache.php | 1 +
maintenance/parserTests.txt | 18 ++++++++++++++++++
2 files changed, 19 insertions(+)
diff --git a/includes/MessageCache.php b/includes/MessageCache.php
index 0e2b8f9328..75c14d63b3 100644
--- a/includes/MessageCache.php
+++ b/includes/MessageCache.php
@@ -446,6 +446,7 @@ class MessageCache {
# Normalise title-case input
$lckey = $wgContLang->lcfirst( $key );
+ $lckey = str_replace( ' ', '_', $lckey );
# Try the MediaWiki namespace
if( !$this->mDisable && $useDB ) {
diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt
index 730b038da1..3d748aef3a 100644
--- a/maintenance/parserTests.txt
+++ b/maintenance/parserTests.txt
@@ -4777,6 +4777,24 @@ Transclusion of nonexistent MediaWiki message
!! end
+!! test
+Transclusion of MediaWiki message with underscore
+!! input
+{{MediaWiki:history_short}}
+!! result
+History
+
+!! end
+
+!! test
+Transclusion of MediaWiki message with space
+!! input
+{{MediaWiki:history short}}
+!! result
+History
+
+!! end
+
!! test
Invalid header with following text
!! input
--
2.20.1