From 1bddb65c2eae97988286d410bd081d8370a71f03 Mon Sep 17 00:00:00 2001 From: Brian Wolff Date: Wed, 11 Dec 2013 16:06:57 -0700 Subject: [PATCH] Always give sane output for Title::getUserCaseDBkey() Sometimes (e.g. via Title::makeTitle), the usercase db key is not set. If that happens we should fallback to the normal db key. This fixes file redirects on repos where initialCapital is set to false. Change-Id: I38bc4ebeb41b06f5c718cf5f64da158e6c1a9f49 --- includes/Title.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/includes/Title.php b/includes/Title.php index a949ac301b..924027e537 100644 --- a/includes/Title.php +++ b/includes/Title.php @@ -769,7 +769,12 @@ class Title { * @return String DB key */ function getUserCaseDBKey() { - return $this->mUserCaseDBKey; + if ( !is_null( $this->mUserCaseDBKey ) ) { + return $this->mUserCaseDBKey; + } else { + // If created via makeTitle(), $this->mUserCaseDBKey is not set. + return $this->mDbkeyform; + } } /** -- 2.20.1