From 70f260f6e395af7c6061e2b07ea91b85b28532f1 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 8 Oct 2024 10:31:48 +0200 Subject: [PATCH] restore 7.0 compatibility --- provider.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/provider.c b/provider.c index f1f8e2a..5f988b5 100644 --- a/provider.c +++ b/provider.c @@ -960,7 +960,11 @@ SOP_METHOD(generateToken) php_error_docref(NULL, E_WARNING, "Could not gather enough random data, falling back on rand()"); } while (reaped < size) { +#if PHP_VERSION_ID < 70100 + iv[reaped++] = (char) (255.0 * php_rand() / RAND_MAX); +#else iv[reaped++] = (char)php_mt_rand_range(0, 255); +#endif } } -- 2.46.2