From: Florian Date: Wed, 13 Jan 2016 17:55:08 +0000 (+0100) Subject: wfMsgReplaceArgs: Don't use count(), if the actual amount of entries isn't needed X-Git-Tag: 1.31.0-rc.0~8128^2 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=15c2401d0c0b038a75a1862430c762b21630d913;p=lhc%2Fweb%2Fwiklou.git wfMsgReplaceArgs: Don't use count(), if the actual amount of entries isn't needed The only use of the return value of count() is, to check, if the array is empty or not. This can be done in an easier way and a bit more performant, especially for large arrays. Change-Id: If119ead9230ba1783b8c853c18c379f174910e51 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 4d0ebf60e3..40669459e4 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -1475,7 +1475,7 @@ function wfMsgReplaceArgs( $message, $args ) { $message = str_replace( "\r", '', $message ); // Replace arguments - if ( count( $args ) ) { + if ( is_array( $args ) && $args ) { if ( is_array( $args[0] ) ) { $args = array_values( $args[0] ); }