note 84427 deleted from function.vsprintf by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:02:30 +0000 |
| Subject: | note 84427 deleted from function.vsprintf by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196755@lists.php.net to get a copy of this message | ||
Note Submitter: jan dot ulrych at gmail dot com
----
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.