From 472b883cc6834f3791fe037f69ec87c635d44d0c Mon Sep 17 00:00:00 2001 From: David Soria Parra Date: Sun, 18 May 2008 17:08:56 +0000 Subject: [PATCH] Make mcrypt_enc_self_test() return value compatible with documentation and mcrypt _module_self_test() --- ext/mcrypt/mcrypt.c | 7 ++++++- ext/mcrypt/tests/mcrypt_enc_self_test.phpt | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) 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) -- 2.50.1