Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 2e86efb

Browse files
author
Jamie Snape
committed
Escape variables in oauth module
1 parent b6e14c5 commit 2e86efb

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

modules/oauth/views/authorize/index.phtml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@
4646
<div class="authorizationText">
4747
<img class="secureImage" alt="" src="<?php echo $this->coreWebroot ?>/public/images/icons/lock.png"/>
4848
By logging in, you are authorizing
49-
<b><?php echo $this->client->getName() ?></b>
49+
<b><?php echo $this->escape($this->client->getName()); ?></b>
5050
to perform the following actions:
5151
<ul class="scopeList">
5252
<?php
5353
foreach ($this->scopeStrings as $scopeString) {
54-
echo '<li>'.$scopeString.'</li>';
54+
echo '<li>'.$this->escape($scopeString).'</li>';
5555
}
5656
?>
5757
</ul>
@@ -65,10 +65,10 @@
6565
<input class="btn btn-primary loginSubmit" type="submit" name="allowOrDeny" value="Allow"/>
6666
<input class="btn loginDeny" type="submit" name="allowOrDeny" value="Deny"/>
6767
</div>
68-
<input type="hidden" name="redirect_uri" value="<?php echo $this->redirectUri ?>"/>
69-
<input type="hidden" name="state" value="<?php echo htmlspecialchars($this->state) ?>"/>
70-
<input type="hidden" name="scope" value="<?php echo htmlspecialchars($this->scope) ?>"/>
71-
<input type="hidden" name="client_id" value="<?php echo $this->client->getKey() ?>"/>
68+
<input type="hidden" name="redirect_uri" value="<?php echo $this->escape($this->redirectUri); ?>"/>
69+
<input type="hidden" name="state" value="<?php echo $this->escape($this->state) ?>"/>
70+
<input type="hidden" name="scope" value="<?php echo $this->escape($this->scope) ?>"/>
71+
<input type="hidden" name="client_id" value="<?php echo $this->escape($this->client->getKey()) ?>"/>
7272
</form>
7373
</div>
7474
</body>

modules/oauth/views/client/index.phtml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@
4040
<tbody>
4141
<?php
4242
foreach ($this->clients as $client) {
43-
echo '<tr><td>'.$client->getName().'</td><td>'.$client->getKey().'</td><td>'.$client->getSecret(
44-
).'</td><td><a class="deleteClientLink" element="'.$client->getKey().'">Delete</a></td></tr>';
43+
echo '<tr><td>'.$this->escape($client->getName()).'</td><td>'.$client->getKey().'</td><td>'.$this->escape($client->getSecret(
44+
)).'</td><td><a class="deleteClientLink" element="'.$this->escape($client->getKey()).'">Delete</a></td></tr>';
4545
}
4646
?>
4747
</tbody>
@@ -66,10 +66,10 @@
6666
<tbody>
6767
<?php
6868
foreach ($this->codes as $code) {
69-
echo '<tr><td>'.$code->getClient()->getName().'</td><td>Authorization Code</td><td></td></tr>';
69+
echo '<tr><td>'.$this->escape($code->getClient()->getName()).'</td><td>Authorization Code</td><td></td></tr>';
7070
}
7171
foreach ($this->tokens as $token) {
72-
echo '<tr><td>'.$token->getClient()->getName().'</td><td>';
72+
echo '<tr><td>'.$this->escape($token->getClient()->getName()).'</td><td>';
7373
switch ($token->getType()) {
7474
case MIDAS_OAUTH_TOKEN_TYPE_ACCESS:
7575
echo 'Access token';
@@ -78,11 +78,11 @@
7878
echo 'Refresh token';
7979
break;
8080
default:
81-
echo $token->getType();
81+
echo $this->escape($token->getType());
8282
break;
8383
}
84-
echo '</td><td><a class="deauthorizeTokenLink" type="'.$token->getType().'" element="'.$token->getKey(
85-
).'">'.'Deauthorize</a></td></tr>';
84+
echo '</td><td><a class="deauthorizeTokenLink" type="'.$this->escape($token->getType()).'" element="'.$this->escape($token->getKey(
85+
)).'">'.'Deauthorize</a></td></tr>';
8686
}
8787
?>
8888
</tbody>
@@ -118,4 +118,4 @@
118118
</div>
119119
</div>
120120

121-
<div class="userIdValue" style="display: none;"><?php echo $this->user->getKey() ?></div>
121+
<div class="userIdValue" style="display: none;"><?php echo $this->escape($this->user->getKey()); ?></div>

0 commit comments

Comments
 (0)