Skip to content

Commit

Permalink
fix undefined index (fix jsxc/jsxc#726)
Browse files Browse the repository at this point in the history
  • Loading branch information
sualko committed Nov 2, 2018
1 parent d2bb0d3 commit d2825e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/Settings/Personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getForm()

if (is_array($options)) {
$loginFormEnable = null;
if (is_array($options['loginForm']) && isset($options['loginForm']['enable'])) {
if (isset($options['loginForm']) && is_array($options['loginForm']) && isset($options['loginForm']['enable'])) {
$loginFormEnable = $options['loginForm']['enable'];
}

Expand All @@ -47,7 +47,7 @@ public function getForm()
$parameters['loginForm'] = 'default';
}

if (is_array($options['xmpp'])) {
if (isset($options['xmpp']) && is_array($options['xmpp'])) {
if (!empty($options['xmpp']['username'])) {
$node = $options['xmpp']['username'];
$parameters['xmppUsername'] = $options['xmpp']['username'];
Expand All @@ -68,7 +68,7 @@ public function getForm()
$xmppOverwrite = $this->config->getAppValue('ojsxc', 'xmppOverwrite');

$parameters['xmppUrl'] = $this->config->getAppValue('ojsxc', 'boshUrl');
$parameters['externalConnectable'] = Application::getServerType() !== Application.INTERNAL;
$parameters['externalConnectable'] = Application::getServerType() !== Application::INTERNAL;
$parameters['allowToOverwriteXMPPConfig'] = $xmppOverwrite === 'true';
$parameters['jid'] = $node . '@' . $domain;

Expand Down
2 changes: 1 addition & 1 deletion templates/settings/personal.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
</p>
</div>

<?php if($_['externalConnectable']): ?>
<?php if(isset($_['externalConnectable']) && $_['externalConnectable']): ?>
<h3>Connection parameters</h3>

<div>
Expand Down

0 comments on commit d2825e2

Please sign in to comment.