|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2014-10-21 13:55 UTC] eep at mailinator dot com
Description:
------------
vsprintf() doesn't validate formatting strings, seems to only count percent signs (followed by pretty much anything). For example, '%)' expects one parameter.
Test script:
---------------
<?php
vsprintf('(foo %) bar');
Actual result:
--------------
Warning: Wrong parameter count for vsprintf() in /vsprintf.php on line 2
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 03:00:01 2025 UTC |
I just realized the provided test script is bad, since second parameter is not optional. However, even with some parameters, the argument count is still counted wrong. printf('%s (foo %) bar', 'test'); ..produces the same warning.