summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2019-10-10 15:30:41 +0200
committerRemi Collet <remi@remirepo.net>2019-10-10 15:30:41 +0200
commitff033b4ed78262f6999ba329e149576ace36862d (patch)
tree2c92d95c3e03cc6d7f7f391a84aff6470b2f2cdd
parent63fca7d32c148532229273bc0a11eee82e93a4d6 (diff)
add patch for PHP 7.4
-rw-r--r--php-sabre-http-php74.patch27
-rw-r--r--php-sabre-http.spec8
2 files changed, 34 insertions, 1 deletions
diff --git a/php-sabre-http-php74.patch b/php-sabre-http-php74.patch
new file mode 100644
index 0000000..38cfe2f
--- /dev/null
+++ b/php-sabre-http-php74.patch
@@ -0,0 +1,27 @@
+Adapted for v4 from:
+
+From 987e14a077fca2d950bc9f555173fa7bb71c0096 Mon Sep 17 00:00:00 2001
+From: Remi Collet <remi@famillecollet.com>
+Date: Wed, 11 Sep 2019 14:31:57 +0200
+Subject: [PATCH] fix "Trying to access array offset on value of type bool" in
+ 7.4 (#121)
+
+---
+ lib/Auth/Digest.php | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/lib/Auth/Digest.php b/lib/Auth/Digest.php
+index 23c28f8..dd35a0b 100644
+--- a/lib/Auth/Digest.php
++++ b/lib/Auth/Digest.php
+@@ -135,6 +135,10 @@
+ */
+ protected function validate() {
+
++ if (!is_array($this->digestParts)) {
++ return false;
++ }
++
+ $A2 = $this->request->getMethod() . ':' . $this->digestParts['uri'];
+
+ if ($this->digestParts['qop'] == 'auth-int') {
diff --git a/php-sabre-http.spec b/php-sabre-http.spec
index 0546dc4..b041a22 100644
--- a/php-sabre-http.spec
+++ b/php-sabre-http.spec
@@ -16,13 +16,15 @@
Name: php-sabre-%{gh_project}
Summary: Library for dealing with http requests and responses
Version: 4.2.4
-Release: 4%{?dist}
+Release: 6%{?dist}
URL: https://github.com/%{gh_owner}/%{gh_project}
License: BSD
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
Source1: %{name}-autoload.php
+Patch0: %{name}-php74.patch
+
BuildArch: noarch
%if %{with_tests}
BuildRequires: php(language) > 5.4
@@ -113,6 +115,7 @@ Autoloader: %{_datadir}/php/Sabre/HTTP/autoload.php
%prep
%setup -q -n %{gh_project}-%{gh_commit}
+%patch0 -p1
cp %{SOURCE1} lib/autoload.php
@@ -154,6 +157,9 @@ exit $ret
%changelog
+* Thu Oct 10 2019 Remi Collet <remi@remirepo.net> - 4.2.4-6
+- add patch for PHP 7.4
+
* Fri Jul 5 2019 Remi Collet <remi@remirepo.net> - 4.2.4-4
- fix autoloader