FIX Only use values that are not empty

Previously the isset check would still allow falsey values.
This commit is contained in:
Michal Kleiner 2021-08-23 23:55:13 +12:00
parent b3f21a5ef2
commit 83af73c9f6
3 changed files with 9 additions and 6 deletions

View File

@ -13,7 +13,7 @@ class SolrConfigStore_File implements SolrConfigStore
public function __construct($config)
{
$this->local = $config['path'];
$this->remote = isset($config['remotepath']) ? $config['remotepath'] : $config['path'];
$this->remote = !empty($config['remotepath']) ? $config['remotepath'] : $config['path'];
}
public function getTargetDir($index)

View File

@ -26,12 +26,12 @@ class SolrConfigStore_Post implements SolrConfigStore
$this->url = implode('', [
'http://',
isset($config['auth']) ? $config['auth'] . '@' : '',
!empty($config['auth']) ? $config['auth'] . '@' : '',
$options['host'] . ':' . $options['port'],
$config['path']
]);
if (isset($config['remotepath'])) {
if (!empty($config['remotepath'])) {
$this->remote = $config['remotepath'];
}
}

View File

@ -18,11 +18,14 @@ class SolrConfigStore_WebDAV implements SolrConfigStore
$this->url = implode('', array(
'http://',
isset($config['auth']) ? $config['auth'] . '@' : '',
$options['host'] . ':' . (isset($config['port']) ? $config['port'] : $options['port']),
!empty($config['auth']) ? $config['auth'] . '@' : '',
$options['host'] . ':' . (!empty($config['port']) ? $config['port'] : $options['port']),
$config['path']
));
$this->remote = $config['remotepath'];
if (!empty($config['remotepath'])) {
$this->remote = $config['remotepath'];
}
}
public function getTargetDir($index)