|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25364 sprintf bug
Submitted: 2003-09-02 12:35 UTC Modified: 2003-09-08 09:34 UTC
Avg. Score:3.7 ± 0.9
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: reha at bilgiparki dot com Assigned:
Status: No Feedback Package: Strings related
PHP Version: 4.3.3 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
39 + 32 = ?
Subscribe to this entry?

 [2003-09-02 12:35 UTC] reha at bilgiparki dot com
I guess that, sprintf function has a bug. Which command damages inserted values or texts.

Reproduce code:
<p><strong>Merhaba %s %s</strong><BR>
  Cenebaz.Com ?yeli?i i?in ba?vurdunuz. ?yeli?inizin kabul edilebilmesi i?in a?a??daki 
  link'e t?klaman?z gerekmektedir.<BR>
  Kullan?c? ad? : %s<BR>
  ?ifreniz : %s<br>
  <strong>?yelik Onay</strong></p>
<table width=\"130\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">
    <td align=\"center\"><a href=\"\">?yeli?imi onayla</a></td>
<p><strong>?yelik ?ptal</strong></p>
<table width=\"130\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\">
    <td align=\"center\"><a href=\"\">?yeli?imi 
      iptal et</a></td>
<p><font color=\"#FF0000\">Cenebaz ?yesi oldu?unuzda, ?ye panelinden Canl? Sohbet 
  i?in kullan?c? yaratabilir ve sohbete hemen kat?labilirsiniz.</font></p>
  <A HREF=''></A></p>

$member_securitycode = 34567823;
$member_firstname = "xx";
$member_lastname = "xx";
$username = "xx";
$password = "xx";
$member_username = "xx";
$member_mail = "";

$mesaj = sprintf($ONAYLAMAMAIL, $member_firstname, $member_lastname, $username, $password, $member_securitycode, $member_username, $member_email, $member_securitycode, $username, $member_email);

echo $mesaj;

Expected result:
there should be get right $member_securitycode like 34567823 but sometimes it could be like 3456782 number.. It randomly crops a digit or a char (sometimes more than one char). I have fixed only loading php4.3.2 version, and the problem is solved.

Actual result:
I can show the bug to you if you wish. My server is running on php4.3.2 now. Because php4.3.3 has this bug.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-02 12:41 UTC]
Please provide shorter example. And without those weird characters.

 [2003-09-08 09:34 UTC]
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Sep 30 04:01:25 2023 UTC