summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--oauth-php84.patch44
-rw-r--r--php-pecl-oauth.spec15
2 files changed, 46 insertions, 13 deletions
diff --git a/oauth-php84.patch b/oauth-php84.patch
index 6b7f163..3eacf17 100644
--- a/oauth-php84.patch
+++ b/oauth-php84.patch
@@ -1,13 +1,13 @@
-From 5b2b573d2bc7d894fe247978b7b42644218aad0b Mon Sep 17 00:00:00 2001
+From e7f262becf3feb65c8195fff4591d9dbd8acbace Mon Sep 17 00:00:00 2001
From: Remi Collet <remi@php.net>
Date: Tue, 9 Jul 2024 15:09:40 +0200
-Subject: [PATCH] fix for PHP 8.4
+Subject: [PATCH 1/2] fix for PHP 8.4
---
oauth.c | 2 +-
php_oauth.h | 6 +++++-
- provider.c | 4 +++-
- 3 files changed, 9 insertions(+), 3 deletions(-)
+ provider.c | 6 +++++-
+ 3 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/oauth.c b/oauth.c
index 46fe08b..9bd8d2a 100644
@@ -48,20 +48,23 @@ index e5a1225..63a29ec 100644
#include "php_network.h"
diff --git a/provider.c b/provider.c
-index cd853f0..5247441 100644
+index cd853f0..f1f8e2a 100644
--- a/provider.c
+++ b/provider.c
-@@ -236,7 +236,9 @@ static int oauth_provider_parse_auth_header(php_oauth_provider *sop, char *auth_
+@@ -235,8 +235,12 @@ static int oauth_provider_parse_auth_header(php_oauth_provider *sop, char *auth_
+ #endif
&return_value,
&subpats,
- 1, /* global */
+#if PHP_VERSION_ID < 80400
+ 1, /* global */
1, /* use flags */
++#else
++ true, /* global */
+#endif
2, /* PREG_SET_ORDER */
0
);
-@@ -956,7 +958,7 @@ SOP_METHOD(generateToken)
+@@ -956,7 +960,7 @@ SOP_METHOD(generateToken)
php_error_docref(NULL, E_WARNING, "Could not gather enough random data, falling back on rand()");
}
while (reaped < size) {
@@ -70,3 +73,28 @@ index cd853f0..5247441 100644
}
}
+
+From 95f349152e6e0797068970ca7e6b265310316c0f Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@php.net>
+Date: Mon, 30 Sep 2024 09:36:58 +0200
+Subject: [PATCH 2/2] use zend_str_tolower
+
+---
+ oauth.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/oauth.c b/oauth.c
+index 9bd8d2a..24c60c9 100644
+--- a/oauth.c
++++ b/oauth.c
+@@ -599,8 +599,8 @@ zend_string *oauth_generate_sig_base(php_so_object *soo, const char *http_method
+ php_url_free(urlparts);
+ return NULL;
+ }
+- php_strtolower(OAUTH_URL_STR(urlparts->scheme), OAUTH_URL_LEN(urlparts->scheme));
+- php_strtolower(OAUTH_URL_STR(urlparts->host), OAUTH_URL_LEN(urlparts->host));
++ zend_str_tolower(OAUTH_URL_STR(urlparts->scheme), OAUTH_URL_LEN(urlparts->scheme));
++ zend_str_tolower(OAUTH_URL_STR(urlparts->host), OAUTH_URL_LEN(urlparts->host));
+ smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->scheme));
+ smart_string_appends(&sbuf, "://");
+ smart_string_appends(&sbuf, OAUTH_URL_STR(urlparts->host));
diff --git a/php-pecl-oauth.spec b/php-pecl-oauth.spec
index 8eeef4a..0b92684 100644
--- a/php-pecl-oauth.spec
+++ b/php-pecl-oauth.spec
@@ -21,7 +21,7 @@
Name: %{?scl_prefix}php-pecl-oauth
Version: 2.0.7
-Release: 10%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 11%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Summary: PHP OAuth consumer extension
License: BSD-3-Clause
URL: https://pecl.php.net/package/oauth
@@ -96,22 +96,24 @@ mkdir ZTS
cd %{sources}
%{__phpize}
+[ -f Makefile.global ] && GLOBAL=Makefile.global || GLOBAL=build/Makefile.global
+sed -e 's/INSTALL_ROOT/DESTDIR/' -i $GLOBAL
cd ../NTS
%configure --with-php-config=%{__phpconfig}
-make %{?_smp_mflags}
+%make_build
%if %{with_zts}
cd ../ZTS
%configure --with-php-config=%{__ztsphpconfig}
-make %{?_smp_mflags}
+%make_build
%endif
%install
%{?dtsenable}
-make install -C NTS INSTALL_ROOT=%{buildroot}
+%make_install -C NTS
# Drop in the bit of configuration
install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
@@ -120,7 +122,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
%if %{with_zts}
-make install -C ZTS INSTALL_ROOT=%{buildroot}
+%make_install -C ZTS
install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
@@ -171,6 +173,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Mon Sep 30 2024 Remi Collet <remi@remirepo.net> - 2.0.7-11
+- more patch for 8.4
+
* Tue Jul 9 2024 Remi Collet <remi@remirepo.net> - 2.0.7-10
- add patch for PHP 8.4 from
https://github.com/php/pecl-web_services-oauth/pull/30