File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 27
27
namespace OCA \Circles \Service ;
28
28
29
29
use daita \MySmallPhpTools \Model \Nextcloud \NC19Request ;
30
+ use daita \MySmallPhpTools \Traits \TStringTools ;
30
31
use OCA \Circles \Exceptions \GSStatusException ;
31
32
use OCA \Circles \Model \Circle ;
32
33
use OCP \IConfig ;
37
38
38
39
class ConfigService {
39
40
41
+
42
+ use TStringTools;
43
+
44
+
40
45
const CIRCLES_ALLOW_CIRCLES = 'allow_circles ' ;
41
46
const CIRCLES_CONTACT_BACKEND = 'contact_backend ' ;
42
47
const CIRCLES_STILL_FRONTEND = 'still_frontend ' ;
@@ -554,6 +559,17 @@ public function getLocalInstance(): string {
554
559
if ($ localCloudId === '' ) {
555
560
$ cliUrl = $ this ->config ->getSystemValue ('overwrite.cli.url ' , '' );
556
561
$ 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
+
557
573
if (array_key_exists ('port ' , $ local )) {
558
574
return $ local ['host ' ] . ': ' . $ local ['port ' ];
559
575
} else {
You can’t perform that action at this time.
0 commit comments