Skip to content

Commit 62c19c3

Browse files
committed
bypass faulty config
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
1 parent 9cfa83d commit 62c19c3

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

lib/Service/ConfigService.php

+16
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
namespace OCA\Circles\Service;
2828

2929
use daita\MySmallPhpTools\Model\Nextcloud\NC19Request;
30+
use daita\MySmallPhpTools\Traits\TStringTools;
3031
use OCA\Circles\Exceptions\GSStatusException;
3132
use OCA\Circles\Model\Circle;
3233
use OCP\IConfig;
@@ -37,6 +38,10 @@
3738

3839
class ConfigService {
3940

41+
42+
use TStringTools;
43+
44+
4045
const CIRCLES_ALLOW_CIRCLES = 'allow_circles';
4146
const CIRCLES_CONTACT_BACKEND = 'contact_backend';
4247
const CIRCLES_STILL_FRONTEND = 'still_frontend';
@@ -554,6 +559,17 @@ public function getLocalInstance(): string {
554559
if ($localCloudId === '') {
555560
$cliUrl = $this->config->getSystemValue('overwrite.cli.url', '');
556561
$local = parse_url($cliUrl);
562+
if (!is_array($local) || !array_key_exists('host', $local)) {
563+
if ($cliUrl !== '') {
564+
return $cliUrl;
565+
}
566+
567+
$randomCloudId = $this->uuid();
568+
$this->setAppValue(self::LOCAL_CLOUD_ID, $randomCloudId);
569+
570+
return $randomCloudId;
571+
}
572+
557573
if (array_key_exists('port', $local)) {
558574
return $local['host'] . ':' . $local['port'];
559575
} else {

0 commit comments

Comments
 (0)