From 7ba005d503fc55cc0e795bfafcbf12d865e9b056 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 23 May 2011 19:42:00 +0000 Subject: [PATCH] Moved wfEmptyMsg() near other message functions --- includes/GlobalFunctions.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index d20aa5e63b..acea5fbe84 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -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 * -- 2.20.1