From: David Soria Parra Date: Sun, 18 May 2008 17:08:56 +0000 (+0000) Subject: Make mcrypt_enc_self_test() return value compatible with documentation and mcrypt... X-Git-Tag: BEFORE_NEW_PARAMETER_PARSE~197 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=472b883cc6834f3791fe037f69ec87c635d44d0c;p=php Make mcrypt_enc_self_test() return value compatible with documentation and mcrypt _module_self_test() --- diff --git a/ext/mcrypt/mcrypt.c b/ext/mcrypt/mcrypt.c index 7cd8668918..78e7d6f4fd 100644 --- a/ext/mcrypt/mcrypt.c +++ b/ext/mcrypt/mcrypt.c @@ -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; + } } /* }}} */ diff --git a/ext/mcrypt/tests/mcrypt_enc_self_test.phpt b/ext/mcrypt/tests/mcrypt_enc_self_test.phpt index a161e0e02b..54ce213de2 100644 --- a/ext/mcrypt/tests/mcrypt_enc_self_test.phpt +++ b/ext/mcrypt/tests/mcrypt_enc_self_test.phpt @@ -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)