summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/BackgroundJob
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2019-12-12 10:05:36 +0100
committerGeorg Ehrke <developer@georgehrke.com>2019-12-12 10:05:36 +0100
commit27a31cdaf156795b3af70c341e8a5910590dfdfd (patch)
treeca26427c125fdea9c0e196cc74a19ecf22c7bf3b /apps/dav/lib/BackgroundJob
parenta33a4c53ef9e37df3b69dfad148bf50bb74020b7 (diff)
downloadnextcloud-server-27a31cdaf156795b3af70c341e8a5910590dfdfd.tar.gz
nextcloud-server-27a31cdaf156795b3af70c341e8a5910590dfdfd.zip
Support more IPv6 addresses in the RefreshWebcalJob
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib/BackgroundJob')
-rw-r--r--apps/dav/lib/BackgroundJob/RefreshWebcalJob.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php b/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
index 3d0be2af9b2..1c0d185e90b 100644
--- a/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
+++ b/apps/dav/lib/BackgroundJob/RefreshWebcalJob.php
@@ -251,6 +251,17 @@ class RefreshWebcalJob extends Job {
$this->logger->warning("Subscription $subscriptionId was not refreshed because it violates local access rules");
return null;
}
+
+ // Also check for IPv6 IPv4 nesting, because that's not covered by filter_var
+ if ((bool)filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) && substr_count($host, '.') > 0) {
+ $delimiter = strrpos($host, ':'); // Get last colon
+ $ipv4Address = substr($host, $delimiter + 1);
+
+ if (!filter_var($ipv4Address, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)) {
+ $this->logger->warning("Subscription $subscriptionId was not refreshed because it violates local access rules");
+ return null;
+ }
+ }
}
try {