Skip to content

Commit

Permalink
[BF] Escape returned data and error messages on login forms
Browse files Browse the repository at this point in the history
  • Loading branch information
barryo committed Apr 6, 2022
1 parent 0ac782d commit c623390
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions resources/views/auth/forgot-password.foil.php
Expand Up @@ -39,9 +39,9 @@
<label class="control-label" for="username">
Username
</label>
<input name="username" class="form-control" id="username" type="text" placeholder="Username" autofocus value="<?= old('username') ?>">
<input name="username" class="form-control" id="username" type="text" placeholder="Username" autofocus value="<?= $t->ee( old('username') ) ?>">
<?php foreach( $t->errors->get( 'username' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand Down
4 changes: 2 additions & 2 deletions resources/views/auth/forgot-username.foil.php
Expand Up @@ -39,9 +39,9 @@
<label class="control-label" for="email">
Email
</label>
<input name="email" class="form-control" id="email" type="text" placeholder="name@example.com" autofocus value="<?= old('email') ?>">
<input name="email" class="form-control" id="email" type="text" placeholder="name@example.com" autofocus value="<?= $t->ee( old('email') ) ?>">
<?php foreach( $t->errors->get( 'email' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand Down
6 changes: 3 additions & 3 deletions resources/views/auth/login.foil.php
Expand Up @@ -34,9 +34,9 @@
<label class="control-label" for="username">
Username
</label>
<input name="username" class="form-control" id="username" type="text" placeholder="Username" autofocus value="<?= old('username') ?>">
<input name="username" class="form-control" id="username" type="text" placeholder="Username" autofocus value="<?= $t->ee( old('username') ) ?>">
<?php foreach( $t->errors->get( 'username' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand All @@ -46,7 +46,7 @@
</label>
<input name="password" class="form-control" id="password" type="password" placeholder="...">
<?php foreach( $t->errors->get( 'password' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand Down
12 changes: 6 additions & 6 deletions resources/views/auth/reset-password.foil.php
Expand Up @@ -40,19 +40,19 @@
Username
</label>

<input name="username" class="form-control" id="username" type="text" placeholder="Username" value="<?= $t->username ?? old('username') ?>">
<input name="username" class="form-control" id="username" type="text" placeholder="Username" value="<?= $t->username ? $t->ee( $t->username ) : $t->ee( old('username') ) ?>">
<?php foreach( $t->errors->get( 'username' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

<div class="tw-mb-6">
<label class="control-label" for="token">
Token
</label>
<input name="token" class="form-control" id="token" type="text" placeholder="" value="<?= $t->token ?? old('token') ?>">
<input name="token" class="form-control" id="token" type="text" placeholder="" value="<?= $t->token ? $t->ee( $t->token ) : $t->ee( old('token') ) ?>">
<?php foreach( $t->errors->get( 'token' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand All @@ -62,7 +62,7 @@
</label>
<input name="password" class="form-control" id="password" type="password" autofocus placeholder="******************">
<?php foreach( $t->errors->get( 'password' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand All @@ -72,7 +72,7 @@
</label>
<input name="password_confirmation" class="form-control" id="password_confirmation" type="password" placeholder="******************">
<?php foreach( $t->errors->get( 'password_confirmation' ) as $err ): ?>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $err ?></p>
<p class="tw-text-red-500 tw-text-xs tw-italic tw-mt-2"><?= $t->ee( $err ) ?></p>
<?php endforeach; ?>
</div>

Expand Down

0 comments on commit c623390

Please sign in to comment.