From: Operating system: Windows XP SP3 PHP version: 5.3.8 Package: Unknown/Other Function Bug Type: Bug Bug description:Metaphone returns string longer than limit
Description: ------------ The metaphone function accepts two parameters: an input string, and a string length limit. With certain input, it is possible to cause metaphone to return a string longer than the specified limit. The issue seems to arise when the string is nearing it's length limit and the following input character is an X, which can translate to a KS, pushing the string over its limit. Test script: --------------- <?php var_dump( metaphone('administratrix', 10) ); var_dump( metaphone('asterix', 5) ); ?> Expected result: ---------------- string(10) "ATMNSTRTRK" string(5) "ASTRK" Actual result: -------------- string(11) "ATMNSTRTRKS" string(6) "ASTRKS" -- Edit bug report at https://bugs.php.net/bug.php?id=60123&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60123&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60123&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60123&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60123&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60123&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60123&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60123&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60123&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60123&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60123&r=support Expected behavior: https://bugs.php.net/fix.php?id=60123&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60123&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60123&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60123&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60123&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=60123&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60123&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60123&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60123&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60123&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60123&r=mysqlcfg