Wait with getting the timezone from the server until we need it

This commit is contained in:
Robin Appelman 2015-03-13 13:12:00 +01:00
commit 476980d4ce
5 changed files with 72 additions and 15 deletions

View file

@ -38,8 +38,6 @@ class Share implements IShare {
*/
protected $parser;
private $serverTimezone;
/**
* @param Server $server
* @param string $name
@ -47,7 +45,7 @@ class Share implements IShare {
public function __construct($server, $name) {
$this->server = $server;
$this->name = $name;
$this->parser = new Parser($this->server->getTimeZone());
$this->parser = new Parser(new TimeZoneProvider($this->server->getHost()));
}
/**
@ -374,6 +372,9 @@ class Share implements IShare {
* @return string
*/
protected function escapePath($path) {
if ($path === '/') {
$path = '';
}
$path = str_replace('/', '\\', $path);
$path = str_replace('"', '^"', $path);
return '"' . $path . '"';