diff options
author | Laurens Stötzel <l.stoetzel@meeva.de> | 2017-12-19 15:23:11 +0300 |
---|---|---|
committer | Laurens Stötzel <l.stoetzel@meeva.de> | 2017-12-19 15:23:11 +0300 |
commit | b4ec47f489e3175bdba14882cdd6836981deb114 (patch) | |
tree | 428c66682e6a75fff2f06827bd8cbd410444b8b3 /templates | |
parent | cbdb3902833195646d156296a8826b62b2280850 (diff) |
Fix PHP notices
Check for undefined variables/array indexes that may occur on token verification.
Diffstat (limited to 'templates')
-rw-r--r-- | templates/form.php | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/templates/form.php b/templates/form.php index bd3450a..e84c8cb 100644 --- a/templates/form.php +++ b/templates/form.php @@ -6,7 +6,7 @@ if ( \OCP\Util::getVersion()[0] >= 12 ) ?><form action="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('registration.register.createAccount', array('token'=>$_['token']))) ?>" method="post"> <input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> <fieldset> - <?php if ( $_['errormsgs'] ) {?> + <?php if ( !empty($_['errormsgs']) ) {?> <ul class="error"> <?php foreach ( $_['errormsgs'] as $errormsg ) { echo "<li>$errormsg</li>"; @@ -18,23 +18,23 @@ if ( \OCP\Util::getVersion()[0] >= 12 ) </ul> <?php } ?> <p class="grouptop"> - <input type="email" name="email" id="email" value="<?php echo $_['email']; ?>" disabled /> - <label for="email" class="infield"><?php echo $_['email']; ?></label> - <img id="email-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/mail.svg')); ?>" alt=""/> + <input type="email" name="email" id="email" value="<?php echo $_['email']; ?>" disabled /> + <label for="email" class="infield"><?php echo $_['email']; ?></label> + <img id="email-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/mail.svg')); ?>" alt=""/> </p> <p class="groupmiddle"> - <input type="text" name="username" id="username" value="<?php echo $_['entered_data']['user']; ?>" placeholder="<?php p($l->t('Username')); ?>" /> - <label for="username" class="infield"><?php p($l->t('Username')); ?></label> - <img id="username-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/user.svg')); ?>" alt=""/> + <input type="text" name="username" id="username" value="<?php echo !empty($_['entered_data']['user']) ? $_['entered_data']['user'] : ''; ?>" placeholder="<?php p($l->t('Username')); ?>" /> + <label for="username" class="infield"><?php p($l->t('Username')); ?></label> + <img id="username-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/user.svg')); ?>" alt=""/> </p> <p class="groupbottom"> - <input type="password" name="password" id="password" placeholder="<?php p($l->t('Password')); ?>"/> - <label for="password" class="infield"><?php p($l->t( 'Password' )); ?></label> - <img id="password-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/> - <input id="show" name="show" type="checkbox"> - <label id="show-password" style="display: inline;" for="show"></label> + <input type="password" name="password" id="password" placeholder="<?php p($l->t('Password')); ?>"/> + <label for="password" class="infield"><?php p($l->t( 'Password' )); ?></label> + <img id="password-icon" class="svg" src="<?php print_unescaped(image_path('', 'actions/password.svg')); ?>" alt=""/> + <input id="show" name="show" type="checkbox"> + <label id="show-password" style="display: inline;" for="show"></label> </p> <input type="submit" id="submit" value="<?php p($l->t('Create account')); ?>" /> </fieldset> |