Skip to content

Commit e5b8f90

Browse files
Nick Evangelouolgabrani
authored andcommitted
Fix 'Undefined index' errors
1 parent 8060927 commit e5b8f90

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

themes/ssp/discopower/disco-tpl.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
$this->data['jquery'] = array('core' => TRUE, 'ui' => TRUE, 'css' => TRUE);
3131

3232

33-
$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML_Module::getModuleUrl('discopower/js/jquery.livesearch.js') . '"></script>';
33+
$this->data['head'] = '<script type="text/javascript" src="' . SimpleSAML_Module::getModuleUrl('discopower/js/jquery.livesearch.js') . '"></script>';
3434
$this->data['head'] .= '<script type="text/javascript" src="' . SimpleSAML_Module::getModuleUrl('discopower/js/' . $this->data['score'] . '.js') . '"></script>';
3535

3636
$this->data['head'] .= '<script type="text/javascript">
@@ -65,7 +65,9 @@ function showEntry($t, $metadata, $favourite = FALSE, $withIcon = FALSE) {
6565

6666

6767
if($withIcon) {
68-
$label = $metadata['login_button']['label'];
68+
if(isset($metadata['login_button']['label']) && !isempty($metadata['login_button']['label'])) {
69+
$label = $metadata['login_button']['label'];
70+
}
6971
$filename = $metadata['login_button']['icon_filename'];
7072
$css_classname = $metadata['login_button']['css_classname'];
7173
$css_button_type = '';
@@ -80,7 +82,9 @@ function showEntry($t, $metadata, $favourite = FALSE, $withIcon = FALSE) {
8082

8183
$html = '<a class="metaentry ssp-btn ' . $css_button_type . ' ' . $css_classname . '" href="' . $basequerystring . urlencode($metadata['entityid']) . '">';
8284
$html .= '<img alt="Identity Provider" class="entryicon" src="' . SimpleSAML_Module::getModuleURL('themevanilla/resources/images/' . $filename ) . '" />';
83-
$html .= '<span>' . $label . '</span></a>';
85+
if (isset($label)) {
86+
$html .= '<span>' . $label . '</span></a>';
87+
}
8488
}
8589
else {
8690
$html = '<a class="metaentry " href="' . $basequerystring . urlencode($metadata['entityid']) . '">';

0 commit comments

Comments
 (0)