Skip to content
This repository was archived by the owner on Jun 25, 2024. It is now read-only.

Commit d6ca58a

Browse files
Merge pull request #20 from silinternational/develop
Error handling bug
2 parents 63cb956 + 77b480a commit d6ca58a

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

themes/material/common-announcement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
$announcement = htmlentities($this->data['announcement']);
2+
$announcement = htmlentities($this->data['announcement'] ?? null);
33

44
if (! empty($announcement)) {
55
?>

themes/material/core/loginuserpass.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<?php include __DIR__ . '/../common-head-elements.php' ?>
77

88
<?php
9-
$siteKey = htmlentities($this->data['recaptcha.siteKey']);
9+
$siteKey = htmlentities($this->data['recaptcha.siteKey'] ?? null);
1010
if (! empty($siteKey)) {
1111
?>
1212
<script src='https://www.google.com/recaptcha/api.js?onload=onRecaptchaLoad&render=explicit'
@@ -67,7 +67,7 @@ function onRecaptchaLoad() {
6767
<?= $this->t('{material:login:label_username}') ?>
6868
</label>
6969
<?php
70-
$username = htmlentities($this->data['username']);
70+
$username = htmlentities($this->data['username'] ?? null);
7171
?>
7272
<input type="text" name="username" class="mdl-textfield__input"
7373
value="<?= $username ?>"
@@ -84,10 +84,10 @@ function onRecaptchaLoad() {
8484
</div>
8585

8686
<?php
87-
$errorCode = htmlentities($this->data['errorcode']);
87+
$errorCode = htmlentities($this->data['errorcode'] ?? null);
8888
if ($errorCode == 'WRONGUSERPASS') {
8989
$errorMessageKey = $this->data['errorparams'][1] ?? '{material:login:error_wronguserpass}';
90-
$errorMessageTokens = $this->data['errorparams'][2];
90+
$errorMessageTokens = $this->data['errorparams'][2] ?? null;
9191

9292
$message = htmlentities($this->t($errorMessageKey, $errorMessageTokens));
9393
?>
@@ -108,7 +108,7 @@ function onRecaptchaLoad() {
108108

109109
<div class="mdl-card__actions" layout-children="row">
110110
<?php
111-
$forgotPasswordUrl = htmlentities($this->data['forgotPasswordUrl']);
111+
$forgotPasswordUrl = htmlentities($this->data['forgotPasswordUrl'] ?? null);
112112
if (! empty($forgotPasswordUrl)) {
113113
?>
114114
<a href="<?= $forgotPasswordUrl ?>" target="_blank"

themes/material/default/selectidp-links.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ function setSelectedIdp(id) {
1010
var idpInput = document.createElement('input');
1111

1212
idpInput.type = 'hidden';
13-
idpInput.name = '<?= htmlspecialchars($this->data['returnIDParam']) ?>';
13+
idpInput.name = <?= json_encode($this->data['returnIDParam'], JSON_HEX_TAG) ?>;
1414
idpInput.value = id;
1515

1616
document.querySelector('form').appendChild(idpInput);
@@ -36,6 +36,7 @@ function clickedAnyway(idpName) {
3636

3737
<main class="mdl-layout__content">
3838
<?php include __DIR__ . '/../common-announcement.php' ?>
39+
3940
<form layout-children="row" child-spacing="space-around">
4041
<input type="hidden" name="entityID"
4142
value="<?= htmlentities($this->data['entityID']) ?>" />

0 commit comments

Comments
 (0)