Allow a configurable path replacement regex.

This can simplify migration from .../home/... to .../calendar/...
for example.
This commit is contained in:
Andrew McMillan 2012-06-17 22:25:25 +12:00
parent ec3996bca7
commit 5ff5933d0c

View File

@ -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 ) ) {