mirror of
https://gitlab.com/davical-project/davical.git
synced 2026-08-30 18:37:12 +00:00
Allow a configurable path replacement regex.
This can simplify migration from .../home/... to .../calendar/... for example.
This commit is contained in:
parent
ec3996bca7
commit
5ff5933d0c
@ -150,6 +150,10 @@ class CalDAVRequest
|
||||
$this->path = $matches[1]. '/';
|
||||
}
|
||||
|
||||
if ( isset($c->replace_path) && isset($c->replace_path['from']) && isset($c->replace_path['to']) ) {
|
||||
$this->path = preg_replace($c->replace_path['from'], $c->replace_path['to'], $this->path);
|
||||
}
|
||||
|
||||
// dbg_error_log( "caldav", "Sanitising path '%s'", $this->path );
|
||||
$bad_chars_regex = '/[\\^\\[\\(\\\\]/';
|
||||
if ( preg_match( $bad_chars_regex, $this->path ) ) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user