#25364 [NEW]: sprintf bug

From: Date: Tue, 02 Sep 2003 17:35:42 +0000
Subject: #25364 [NEW]: sprintf bug
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-47078@lists.php.net to get a copy of this message
From: reha at bilgiparki dot com Operating system: Windows 2000 PHP version: 4.3.3 PHP Bug Type: Strings related Bug description: sprintf bug Description: ------------ I guess that, sprintf function has a bug. Which command damages inserted values or texts. Reproduce code: --------------- $ONAYLAMAMAIL = " <p><strong>Merhaba %s %s</strong><BR> <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> <BR> Kullanýcý adý : %s<BR> Þifreniz : %s<br> <br> <strong>Üyelik Onay</strong></p> <table width=\"130\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\"> <tr> <td align=\"center\"><a href=\"http://www.xxx.com/onay.php?member=onayla&durum=onay&kod=%s&kullanici=%s&mail=%s\">üyeliðimi onayla</a></td> </tr> </table> <p><strong>Üyelik Ýptal</strong></p> <table width=\"130\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#000000\"> <tr> <td align=\"center\"><a href=\"http://www.xxx.com/onay.php?member=iptal&durum=iptal&kod=%s&kullanici=%s&mail=%s\">üyeliðimi iptal et</a></td> </tr> </table> <br> <p><font color=\"#FF0000\">Cenebaz üyesi olduðunuzda, üye panelinden Canlý Sohbet için kullanýcý yaratabilir ve sohbete hemen katýlabilirsiniz.</font></p> <p>Saygýlarýmýzla,<BR> Cenebaz.Com<BR> <A HREF='http://www.xxx.com'>http://www.xxx.com</A></p> "; $member_securitycode = 34567823; $member_firstname = "xx"; $member_lastname = "xx"; $username = "xx"; $password = "xx"; $member_username = "xx"; $member_mail = "xx@xx.com"; $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. -- Edit bug report at http://bugs.php.net/?id=25364&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=25364&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=25364&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=25364&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=25364&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=25364&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=25364&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=25364&r=support Expected behavior: http://bugs.php.net/fix.php?id=25364&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=25364&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=25364&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=25364&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=25364&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=25364&r=dst IIS Stability: http://bugs.php.net/fix.php?id=25364&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=25364&r=gnused

« previous php.bugs (#47078) next »