note 84427 added to function.vsprintf

From: Date: Mon, 14 Jul 2008 08:45:20 +0000
Subject: note 84427 added to function.vsprintf
Groups: php.notes 
Request: Send a blank email to php-notes+get-141470@lists.php.net to get a copy of this message
Thanks a lot for vnsprintf function. However, there is a little bug which occurs only when the number of parameters in the $data is greater than 10. The replacement is not performed correctly when two or more replacements should be performed. When the referenced parameter is at position greater or equal to 10 in $data array and it precedes any other referenced parameter in $format string then the subsequent replacement(s) are not performed correctly. The $offset value should be calculated as $offset -= $len - strlen( 1 + $key); as we substitute string (or float) identifier in the original $format string by value 1 + $key, not $key. ---- Server IP: 147.32.160.17 Probable Submitter: 212.71.186.185 ---- Manual Page -- http://www.php.net/manual/en/function.vsprintf.php Edit -- https://master.php.net/note/edit/84427 Del: integrated -- https://master.php.net/note/delete/84427/integrated Del: useless -- https://master.php.net/note/delete/84427/useless Del: bad code -- https://master.php.net/note/delete/84427/bad+code Del: spam -- https://master.php.net/note/delete/84427/spam Del: non-english -- https://master.php.net/note/delete/84427/non-english Del: in docs -- https://master.php.net/note/delete/84427/in+docs Del: other reasons-- https://master.php.net/note/delete/84427 Reject -- https://master.php.net/note/reject/84427 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#141470) next »