From a7b316a004b3eea4057bc4d3c7c2a2bd270e1d94 Mon Sep 17 00:00:00 2001 From: Andrew Ruthven Date: Thu, 14 May 2015 11:17:18 +1200 Subject: [PATCH] Allow external BIND URL to be file:/// This allows us to load in external files that are copied onto the Davical server via other means. --- inc/caldav-BIND.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/caldav-BIND.php b/inc/caldav-BIND.php index 0e3d8b8c..c314e4d4 100644 --- a/inc/caldav-BIND.php +++ b/inc/caldav-BIND.php @@ -48,7 +48,7 @@ if ( $destination->Exists() ) { } // external binds shouldn't ever point back to ourselves but they should be a valid http[s] url -if ( preg_match ( '{^https?://([^/]+)(:[0-9]\+)?/.+$}', $href, $matches ) +if ( preg_match ( '{^(?:https?://|file:///)([^/]+)(:[0-9]\+)?/.+$}', $href, $matches ) && strcasecmp( $matches[0], 'localhost' ) !== 0 && strcasecmp( $matches[0], '127.0.0.1' ) !== 0 && strcasecmp( $matches[0], $_SERVER['SERVER_NAME'] ) !== 0 && strcasecmp( $matches[0], $_SERVER['SERVER_ADDR'] ) !== 0 ) { require_once('external-fetch.php');