summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-sabre-dav-autoload.php2
-rw-r--r--php-sabre-dav-php74.patch24
-rw-r--r--php-sabre-dav.spec8
3 files changed, 32 insertions, 2 deletions
diff --git a/php-sabre-dav-autoload.php b/php-sabre-dav-autoload.php
index a7fd77f..3336b5c 100644
--- a/php-sabre-dav-autoload.php
+++ b/php-sabre-dav-autoload.php
@@ -9,9 +9,9 @@ require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
\Fedora\Autoloader\Autoload::addPsr4('Sabre\\CardDAV\\', dirname(__DIR__) . '/CardDAV');
\Fedora\Autoloader\Dependencies::required([
+ '/usr/share/php/Sabre/Uri/autoload.php',
'/usr/share/php/Sabre/Event/autoload.php',
'/usr/share/php/Sabre/Xml/autoload.php',
- '/usr/share/php/Sabre/Uri/autoload.php',
'/usr/share/php/Sabre/HTTP/autoload.php',
'/usr/share/php/Sabre/VObject4/autoload.php',
'/usr/share/php/Psr/Log/autoload.php',
diff --git a/php-sabre-dav-php74.patch b/php-sabre-dav-php74.patch
new file mode 100644
index 0000000..ff8d454
--- /dev/null
+++ b/php-sabre-dav-php74.patch
@@ -0,0 +1,24 @@
+diff -up ../lib/DAV/Server.php.php74 ../lib/DAV/Server.php
+--- ../lib/DAV/Server.php.php74 2019-10-11 09:25:27.807508723 +0200
++++ ../lib/DAV/Server.php 2019-10-11 09:25:30.679493668 +0200
+@@ -564,7 +564,7 @@ class Server extends EventEmitter implem
+ */
+ function calculateUri($uri) {
+
+- if ($uri[0] != '/' && strpos($uri, '://')) {
++ if ('' != $uri && '/' != $uri[0] && strpos($uri, '://')) {
+
+ $uri = parse_url($uri, PHP_URL_PATH);
+
+diff -up ../lib/DAV/Xml/Property/Href.php.php74 ../lib/DAV/Xml/Property/Href.php
+--- ../lib/DAV/Xml/Property/Href.php.php74 2019-10-11 09:23:28.870132179 +0200
++++ ../lib/DAV/Xml/Property/Href.php 2019-10-11 09:23:45.854043154 +0200
+@@ -58,7 +58,7 @@ class Href implements Element, HtmlOutpu
+ */
+ function getHref() {
+
+- return $this->hrefs[0];
++ return (isset($this->hrefs[0]) ? $this->hrefs[0] : null);
+
+ }
+
diff --git a/php-sabre-dav.spec b/php-sabre-dav.spec
index 220592b..89d64a1 100644
--- a/php-sabre-dav.spec
+++ b/php-sabre-dav.spec
@@ -19,7 +19,7 @@
Name: php-sabre-%{gh_project}
Summary: WebDAV Framework for PHP
Version: 3.2.3
-Release: 3%{?dist}
+Release: 5%{?dist}
URL: https://github.com/%{gh_owner}/%{gh_project}
License: BSD
@@ -32,6 +32,8 @@ Patch0: %{name}-autoload.patch
Patch1: https://patch-diff.githubusercontent.com/raw/fruux/sabre-dav/pull/1006.patch
# For PHP 7.3
Patch2: https://github.com/sabre-io/dav/commit/5eb5d74514230b11c80b67c7e147242757ccc660.patch
+# For PHP 7.4
+Patch3: %{name}-php74.patch
BuildArch: noarch
%if %{with_tests}
@@ -164,6 +166,7 @@ Autoloader: %{_datadir}/php/Sabre/DAV/autoload.php
%patch0 -p1 -b .rpm
%patch1 -p1
%patch2 -p1
+%patch3 -p1
cp %{SOURCE1} lib/DAV/autoload.php
@@ -221,6 +224,9 @@ exit $ret
%changelog
+* Mon Jul 1 2019 Remi Collet <remi@remirepo.net> - 3.2.3-5
+- add patch for PHP 7.4 backported from v4
+
* Mon Jul 1 2019 Remi Collet <remi@remirepo.net> - 3.2.3-3
- change autoloader order to ensure same versions are used