From e0f6f3d27a3ac6b77b17cad8cdcdf0fff2e45685 Mon Sep 17 00:00:00 2001 From: Jonathan Treffler Date: Wed, 12 Jun 2024 21:50:28 +0200 Subject: [PATCH] follow spec more closely for subscription request parsing --- lib/Dav/SubscriptionManagementPlugin.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Dav/SubscriptionManagementPlugin.php b/lib/Dav/SubscriptionManagementPlugin.php index 4d9a34a..de5074e 100644 --- a/lib/Dav/SubscriptionManagementPlugin.php +++ b/lib/Dav/SubscriptionManagementPlugin.php @@ -107,7 +107,10 @@ class SubscriptionManagementPlugin extends ServerPlugin { $subscriptionParameterIncluded = True; if(sizeof($parameter["value"]) == 1) { - $subscriptionType = preg_replace('/^\{DAV:Push\}/', '', $parameter["value"][0]["name"]); + $subscriptionType = $parameter["value"][0]["name"]; + $subscriptionType = preg_replace('/^\{DAV:Push\}/', '', $subscriptionType); + $subscriptionType = preg_replace('/-subscription$/', '', $subscriptionType); + $subscriptionOptions = $parameter["value"][0]["value"]; } else { $errors[] = "only one subscription allowed";