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.
This commit is contained in:
Andrew Ruthven 2015-05-14 11:17:18 +12:00
parent 642524d391
commit a7b316a004

View File

@ -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');