]> granicus.if.org Git - php/commitdiff
Metaphone will work only with binary runtime-encoded strings.
authorAndrei Zmievski <andrei@php.net>
Thu, 21 Dec 2006 23:43:52 +0000 (23:43 +0000)
committerAndrei Zmievski <andrei@php.net>
Thu, 21 Dec 2006 23:43:52 +0000 (23:43 +0000)
ext/standard/metaphone.c

index 86e96f9a58290b98199534de58e058c5cb0ba936..0c509577241caf74fd580815ad82eea92adcebe4 100644 (file)
@@ -27,7 +27,7 @@
 
 static int metaphone(unsigned char *word, int word_len, long max_phonemes, char **phoned_word, int traditional);
 
-/* {{{ proto string metaphone(string text[, int phones])
+/* {{{ proto string metaphone(string text[, int phones]) U
    Break english phrases down into their phonemes */
 PHP_FUNCTION(metaphone)
 {
@@ -42,7 +42,7 @@ PHP_FUNCTION(metaphone)
        }
 
        if (metaphone((unsigned char *)str, str_len, phones, &result, 1) == 0) {
-               RETVAL_STRING(result, 0);
+               RETVAL_ASCII_STRING(result, ZSTR_AUTOFREE);
        } else {
                if (result) {
                        efree(result);