From 15c2401d0c0b038a75a1862430c762b21630d913 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 13 Jan 2016 18:55:08 +0100 Subject: [PATCH] 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 --- includes/GlobalFunctions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] ); } -- 2.20.1