mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-05-19 01:34:26 +00:00
When creating an external bind attempts to create an external bind to the local host should be excluded
This commit is contained in:
parent
35e1ae64b0
commit
5bea2e16d1
@ -47,7 +47,8 @@ if ( $destination->Exists() ) {
|
|||||||
$request->PreconditionFailed(403,'DAV::can-overwrite',translate('A resource already exists at the destination.'));
|
$request->PreconditionFailed(403,'DAV::can-overwrite',translate('A resource already exists at the destination.'));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( preg_match ( '{^https?://[A-Za-z][^/]*/.+$}', $href ) ) {
|
if ( preg_match ( '{^https?://[A-Za-z][^/]*/.+$}', $href ) && ! stripos( $href, 'localhost' ) < 9
|
||||||
|
&& ! stripos( $href, '127.0.0.1' ) < 9 && ! stripos( $href, $_SERVER['SERVER_NAME'] ) < 9 && ! stripos( $href, $_SERVER['SERVER_ADDR'] ) < 9 ) {
|
||||||
require_once('external-fetch.php');
|
require_once('external-fetch.php');
|
||||||
$qry = new AwlQuery( );
|
$qry = new AwlQuery( );
|
||||||
$qry->QDo('SELECT collection_id FROM collection WHERE dav_name = :dav_name ', array( ':dav_name' => '/.external/'. md5($href) ));
|
$qry->QDo('SELECT collection_id FROM collection WHERE dav_name = :dav_name ', array( ':dav_name' => '/.external/'. md5($href) ));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user