File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 2727namespace OCA \Circles \Service ;
2828
2929use daita \MySmallPhpTools \Model \Nextcloud \NC19Request ;
30+ use daita \MySmallPhpTools \Traits \TStringTools ;
3031use OCA \Circles \Exceptions \GSStatusException ;
3132use OCA \Circles \Model \Circle ;
3233use OCP \IConfig ;
3738
3839class 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 {
You can’t perform that action at this time.
0 commit comments