Moved wfEmptyMsg() near other message functions
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 23 May 2011 19:42:00 +0000 (19:42 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 23 May 2011 19:42:00 +0000 (19:42 +0000)
includes/GlobalFunctions.php

index d20aa5e..acea5fb 100644 (file)
@@ -989,6 +989,18 @@ function wfMsgExt( $key, $options ) {
        return $string;
 }
 
+/**
+ * Since wfMsg() and co suck, they don't return false if the message key they
+ * looked up didn't exist but a XHTML string, this function checks for the
+ * nonexistance of messages by checking the MessageCache::get() result directly.
+ *
+ * @param $key      String: the message key looked up
+ * @return Boolean True if the message *doesn't* exist.
+ */
+function wfEmptyMsg( $key ) {
+       return MessageCache::singleton()->get( $key, /*useDB*/true, /*content*/false ) === false;
+}
+
 /**
  * Print an error message and die, returning nonzero to the shell if any.  Plain die()
  * fails to return nonzero to the shell if you pass a string.  Entry points may customise
@@ -2337,18 +2349,6 @@ function wfPercent( $nr, $acc = 2, $round = true ) {
        return $round ? round( $ret, $acc ) . '%' : "$ret%";
 }
 
-/**
- * Since wfMsg() and co suck, they don't return false if the message key they
- * looked up didn't exist but a XHTML string, this function checks for the
- * nonexistance of messages by checking the MessageCache::get() result directly.
- *
- * @param $key      String: the message key looked up
- * @return Boolean True if the message *doesn't* exist.
- */
-function wfEmptyMsg( $key ) {
-       return MessageCache::singleton()->get( $key, /*useDB*/true, /*content*/false ) === false;
-}
-
 /**
  * Find out whether or not a mixed variable exists in a string
  *