]> granicus.if.org Git - php/commitdiff
Make mcrypt_enc_self_test() return value compatible with documentation and mcrypt...
authorDavid Soria Parra <dsp@php.net>
Sun, 18 May 2008 17:08:56 +0000 (17:08 +0000)
committerDavid Soria Parra <dsp@php.net>
Sun, 18 May 2008 17:08:56 +0000 (17:08 +0000)
ext/mcrypt/mcrypt.c
ext/mcrypt/tests/mcrypt_enc_self_test.phpt

index 7cd86689184dbaa200abd1e99ca3cac4081cb797..78e7d6f4fdb1bda028e1a0c275aaeabe7fbbbb11 100644 (file)
@@ -589,7 +589,12 @@ PHP_FUNCTION(mcrypt_enc_get_supported_key_sizes)
 PHP_FUNCTION(mcrypt_enc_self_test)
 {
        MCRYPT_GET_TD_ARG
-       RETURN_LONG(mcrypt_enc_self_test(pm->td));
+
+       if (mcrypt_enc_self_test(pm->td) == 0) {
+               RETURN_TRUE;
+       } else {
+               RETURN_FALSE;
+       }
 }
 /* }}} */
 
index a161e0e02befbf63d4c1f120b8ea59edac7ee4fd..54ce213de2d7798d5f66d5c1a4ccd563a69bb167 100644 (file)
@@ -7,4 +7,4 @@ mcrypt_enc_self_test
 $td = mcrypt_module_open(MCRYPT_RIJNDAEL_256, '', MCRYPT_MODE_CBC, '');
 var_dump(mcrypt_enc_self_test($td));
 --EXPECT--
-int(0)
\ No newline at end of file
+bool(true)