- function get( $key, $useDB, $forcontent=true, $isfullkey = false ) {
- global $wgContLanguageCode;
- if( $forcontent ) {
- global $wgContLang;
- $lang =& $wgContLang;
- $langcode = $wgContLanguageCode;
- } else {
- global $wgLang, $wgLanguageCode;
- $lang =& $wgLang;
- $langcode = $wgLanguageCode;
- }
- # If uninitialised, someone is trying to call this halfway through Setup.php
- if( !$this->mInitialised ) {
- return '<' . htmlspecialchars($key) . '>';
- }
- # If cache initialization was deferred, start it now.
- if( $this->mDeferred && !$this->mDisable && $useDB ) {
- $this->load();
+ /**
+ * Get a message from either the content language or the user language.
+ *
+ * @param string $key The message cache key
+ * @param bool $useDB Get the message from the DB, false to use only the localisation
+ * @param string $langcode Code of the language to get the message for, if
+ * it is a valid code create a language for that
+ * language, if it is a string but not a valid code
+ * then make a basic language object, if it is a
+ * false boolean then use the current users
+ * language (as a fallback for the old parameter
+ * functionality), or if it is a true boolean then
+ * use the wikis content language (also as a
+ * fallback).
+ * @param bool $isFullKey Specifies whether $key is a two part key "msg/lang".
+ */
+ function get( $key, $useDB = true, $langcode = true, $isFullKey = false ) {
+ global $wgContLanguageCode, $wgContLang;
+
+ if ( strval( $key ) === '' ) {
+ # Shortcut: the empty key is always missing
+ return '<>';