summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Soria Parra <dsp@php.net>2008-05-18 17:08:56 +0000
committerDavid Soria Parra <dsp@php.net>2008-05-18 17:08:56 +0000
commit472b883cc6834f3791fe037f69ec87c635d44d0c (patch)
tree5c3cb4eff91b7dc70db81a5ed7ef48d1eac30aab
parentd90f689d73367c2134b847030007ec55999db467 (diff)
downloadphp-git-472b883cc6834f3791fe037f69ec87c635d44d0c.tar.gz
Make mcrypt_enc_self_test() return value compatible with documentation and mcrypt _module_self_test()
-rw-r--r--ext/mcrypt/mcrypt.c7
-rw-r--r--ext/mcrypt/tests/mcrypt_enc_self_test.phpt2
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)