From 5b22c24e4467c1b234edc314f16a780e79a79ff8 Mon Sep 17 00:00:00 2001 From: westi Date: Wed, 15 Oct 2008 20:47:56 +0000 Subject: [PATCH] Notice fix and don't count inside a loop. Fixes #7653 props ryan. git-svn-id: http://svn.automattic.com/wordpress/trunk@9189 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 78cb2a371..71dfc8407 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2031,8 +2031,10 @@ function wp_sprintf_l($pattern, $args) { if ( count($args) == 1 ) $result .= $l['between_only_two'] . array_shift($args); // Loop when more than two args - while ( count($args) ) { + $i = count($args); + while ( $i ) { $arg = array_shift($args); + $i--; if ( $i == 1 ) $result .= $l['between_last_two'] . $arg; else