From 5e69614b970c1bf846e19a7a6bdaa35b66b17522 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Thu, 30 Dec 2004 07:17:22 +0000 Subject: [PATCH] r38: Fixed bug with phrase() that didn't properly handle sprintf(). --- includes/functions.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index 4e070ae..0aa6d32 100755 --- a/includes/functions.php +++ b/includes/functions.php @@ -16,7 +16,7 @@ function phrase() global $bugsys; $args = func_get_args(); - $numargs = count($args); + $numargs = sizeof($args); if ($numargs < 1) { @@ -31,7 +31,8 @@ function phrase() } else { - if (!($phrase = @call_user_func_array('sprintf', $args))) + $args[0] = $phrasetext; + if (($phrase = @call_user_func_array('sprintf', $args)) === false) { for ($i = 1; $i < $numargs; $i++) { @@ -39,7 +40,7 @@ function phrase() } } } - return preg_replace('#%([0-9].*?)\$s#', '[ARG \1: UNDEFINED]', $phrase); + return preg_replace('#%([0-9].*?)\$s#', '[ARG \\1: UNDEFINED]', $phrase); } else { -- 2.43.5