summaryrefslogtreecommitdiffstats
path: root/0001-restore-7.0-compatibility.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-restore-7.0-compatibility.patch')
-rw-r--r--0001-restore-7.0-compatibility.patch28
1 files changed, 28 insertions, 0 deletions
diff --git a/0001-restore-7.0-compatibility.patch b/0001-restore-7.0-compatibility.patch
new file mode 100644
index 0000000..766e600
--- /dev/null
+++ b/0001-restore-7.0-compatibility.patch
@@ -0,0 +1,28 @@
+From 70f260f6e395af7c6061e2b07ea91b85b28532f1 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+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
+