From 19bc50ea0387f8852b894a9d89ffd7ac6f7721c3 Mon Sep 17 00:00:00 2001 From: Peter Westwood 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: https://develop.svn.wordpress.org/trunk@9189 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 78cb2a3713..71dfc84071 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