|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesphp-7.0.3-aix-strfmon.patch (last revision 2016-08-30 15:59 UTC by matthieu dot sarter dot external at atos dot net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-01-09 05:34 UTC] krakjoe@php.net
[2017-01-09 05:34 UTC] krakjoe@php.net
-Status: Open
+Status: Closed
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 14:00:01 2025 UTC |
Description: ------------ On AIX strfmon seems to include the terminating \0 in the length returned by strfmon, despite the documentation and the Open Group specifications indicating it is not included. PHP's money_format function uses the value returned by strfmon as the length for the new ZSTR, so this error is also present when using PHP on AIX. The attached patch fixes this issue on PHP side, by using strlen after strfmon to get the size without the trailing \0 (tested with PHP 7.0.3, 7.0.7, 7.0.9 and 7.0.10 on AIX 6.1). Test script: --------------- // From ext/standard/tests/strings/moneyformat.phpt setlocale(LC_MONETARY, 'en_US'); var_dump( money_format("X%nY", 3.1415)); Expected result: ---------------- string(7) "X$3.14Y" Actual result: -------------- string(8) "X$3.14Y"