Making WordPress.org

Changeset 12682


Ignore:
Timestamp:
07/03/2023 04:34:09 AM (10 months ago)
Author:
dd32
Message:

Login: Registration: Better error when a blank form is submitted.

Props nirupagajera.
Fixes #7107.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r12254 r12682  
    198198    if ( is_array( $login_or_email ) && isset( $login_or_email['pending_id'] ) ) {
    199199        return $login_or_email;
     200    }
     201
     202    $login_or_email = trim( $login_or_email );
     203    if ( ! $login_or_email ) {
     204        return false;
    200205    }
    201206
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/register.php

    r12075 r12682  
    7676    <p class="login-username">
    7777        <label for="user_login"><?php _e( 'Username', 'wporg' ); ?></label>
    78         <input type="text" name="user_login" id="user_login" class="input <?php if ( $error_user_login ) echo 'error'; ?>" value="<?php echo esc_attr( $user_login ) ?>" size="20" maxlength="60" />
     78        <input type="text" name="user_login" id="user_login" class="input <?php if ( $error_user_login ) echo 'error'; ?>" value="<?php echo esc_attr( $user_login ) ?>" size="20" maxlength="60" data-pattern-after-blur="[0-9a-z]{0,60}" required />
    7979        <span class="small"><?php _e( 'Only lower case letters (a-z) and numbers (0-9) are allowed.', 'wporg' ); ?></span>
    8080    </p>
     
    9292    <p class="login-email">
    9393        <label for="user_email"><?php _e( 'Email', 'wporg' ); ?></label>
    94         <input type="email" name="user_email" id="user_email" class="input <?php if ( $error_user_email ) echo 'error'; ?>" value="<?php echo esc_attr( $user_email ) ?>" size="20" maxlength="100" />
     94        <input type="email" name="user_email" id="user_email" class="input <?php if ( $error_user_email ) echo 'error'; ?>" value="<?php echo esc_attr( $user_email ) ?>" size="20" maxlength="100" data-pattern-after-blur=".+@.+\..+" required />
    9595        <span class="small"><?php _e( 'A link to set your password will be sent here.', 'wporg' ); ?></span>
    9696    </p>
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/stylesheets/login.css

    r12572 r12682  
    374374
    375375body.login form input.error,
    376 body.login form input:invalid {
     376body.login form input[pattern]:invalid {
    377377    background-color: #fbeaea;
    378378    border: 2px solid #dc3232;
Note: See TracChangeset for help on using the changeset viewer.