Make WordPress Core

Ticket #22183: 22183.2.diff

File 22183.2.diff, 15.0 KB (added by Kau-Boy, 10 years ago)

using type email/url and adding novalidate to all core forms

  • src/wp-admin/user-edit.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    228228 * @since 3.0.0
    229229 */
    230230?>
    231 <form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post"<?php do_action( 'user_edit_form_tag' ); ?>>
     231<form id="your-profile" action="<?php echo esc_url( self_admin_url( IS_PROFILE_PAGE ? 'profile.php' : 'user-edit.php' ) ); ?>" method="post" novalidate="novalidate"<?php do_action( 'user_edit_form_tag' ); ?>>
    232232<?php wp_nonce_field('update-user_' . $user_id) ?>
    233233<?php if ( $wp_http_referer ) : ?>
    234234        <input type="hidden" name="wp_http_referer" value="<?php echo esc_url($wp_http_referer); ?>" />
     
    401401<table class="form-table">
    402402<tr>
    403403        <th><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
    404         <td><input type="text" name="email" id="email" value="<?php echo esc_attr($profileuser->user_email) ?>" class="regular-text ltr" />
     404        <td><input type="email" name="email" id="email" value="<?php echo esc_attr( $profileuser->user_email ) ?>" class="regular-text ltr" />
    405405        <?php
    406406        $new_email = get_option( $current_user->ID . '_new_email' );
    407407        if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
     
    414414
    415415<tr>
    416416        <th><label for="url"><?php _e('Website') ?></label></th>
    417         <td><input type="text" name="url" id="url" value="<?php echo esc_attr($profileuser->user_url) ?>" class="regular-text code" /></td>
     417        <td><input type="url" name="url" id="url" value="<?php echo esc_attr( $profileuser->user_url ) ?>" class="regular-text code" /></td>
    418418</tr>
    419419
    420420<?php
  • src/wp-admin/install.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    9191?>
    9292<p class="message"><?php echo $error; ?></p>
    9393<?php } ?>
    94 <form id="setup" method="post" action="install.php?step=2">
     94<form id="setup" method="post" action="install.php?step=2" novalidate="novalidate">
    9595        <table class="form-table">
    9696                <tr>
    9797                        <th scope="row"><label for="weblog_title"><?php _e( 'Site Title' ); ?></label></th>
     
    127127                <?php endif; ?>
    128128                <tr>
    129129                        <th scope="row"><label for="admin_email"><?php _e( 'Your E-mail' ); ?></label></th>
    130                         <td><input name="admin_email" type="text" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
     130                        <td><input name="admin_email" type="email" id="admin_email" size="25" value="<?php echo esc_attr( $admin_email ); ?>" />
    131131                        <p><?php _e( 'Double-check your email address before continuing.' ); ?></p></td>
    132132                </tr>
    133133                <tr>
  • src/wp-admin/user-new.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    286286 * @since 3.0.0
    287287 */
    288288?>
    289 <form action="" method="post" name="adduser" id="adduser" class="validate"<?php do_action( 'user_new_form_tag' );?>>
     289<form action="" method="post" name="adduser" id="adduser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
    290290<input name="action" type="hidden" value="adduser" />
    291291<?php wp_nonce_field( 'add-user', '_wpnonce_add-user' ) ?>
    292292
    293293<table class="form-table">
    294294        <tr class="form-field form-required">
    295295                <th scope="row"><label for="adduser-email"><?php echo $label; ?></label></th>
    296                 <td><input name="email" type="text" id="adduser-email" class="wp-suggest-user" value="" /></td>
     296                <td><input name="email" type="email" id="adduser-email" class="wp-suggest-user" value="" /></td>
    297297        </tr>
    298298        <tr class="form-field">
    299299                <th scope="row"><label for="adduser-role"><?php _e('Role'); ?></label></th>
     
    334334?>
    335335<p><?php _e('Create a brand new user and add them to this site.'); ?></p>
    336336<?php /** This action is documented in wp-admin/user-new.php */ ?>
    337 <form action="" method="post" name="createuser" id="createuser" class="validate"<?php do_action( 'user_new_form_tag' );?>>
     337<form action="" method="post" name="createuser" id="createuser" class="validate" novalidate="novalidate"<?php do_action( 'user_new_form_tag' );?>>
    338338<input name="action" type="hidden" value="createuser" />
    339339<?php wp_nonce_field( 'create-user', '_wpnonce_create-user' ); ?>
    340340<?php
     
    358358        </tr>
    359359        <tr class="form-field form-required">
    360360                <th scope="row"><label for="email"><?php _e('E-mail'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
    361                 <td><input name="email" type="text" id="email" value="<?php echo esc_attr($new_user_email); ?>" /></td>
     361                <td><input name="email" type="email" id="email" value="<?php echo esc_attr( $new_user_email ); ?>" /></td>
    362362        </tr>
    363363<?php if ( !is_multisite() ) { ?>
    364364        <tr class="form-field">
     
    371371        </tr>
    372372        <tr class="form-field">
    373373                <th scope="row"><label for="url"><?php _e('Website') ?></label></th>
    374                 <td><input name="url" type="text" id="url" class="code" value="<?php echo esc_attr($new_user_uri); ?>" /></td>
     374                <td><input name="url" type="url" id="url" class="code" value="<?php echo esc_attr( $new_user_uri ); ?>" /></td>
    375375        </tr>
    376376<?php
    377377/**
  • src/wp-admin/options-general.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    8686<div class="wrap">
    8787<h2><?php echo esc_html( $title ); ?></h2>
    8888
    89 <form method="post" action="options.php">
     89<form method="post" action="options.php" novalidate="novalidate">
    9090<?php settings_fields('general'); ?>
    9191
    9292<table class="form-table">
     
    102102<?php if ( !is_multisite() ) { ?>
    103103<tr>
    104104<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
    105 <td><input name="siteurl" type="text" id="siteurl" value="<?php form_option('siteurl'); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
     105<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
    106106</tr>
    107107<tr>
    108108<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
    109 <td><input name="home" type="text" id="home" value="<?php form_option('home'); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
     109<td><input name="home" type="url" id="home" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
    110110<p class="description"><?php _e('Enter the address here if you want your site homepage <a href="http://codex.wordpress.org/Giving_WordPress_Its_Own_Directory">to be different from the directory</a> you installed WordPress.'); ?></p></td>
    111111</tr>
    112112<tr>
    113113<th scope="row"><label for="admin_email"><?php _e('E-mail Address') ?> </label></th>
    114 <td><input name="admin_email" type="text" id="admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
     114<td><input name="admin_email" type="email" id="admin_email" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
    115115<p class="description"><?php _e('This address is used for admin purposes, like new user notification.') ?></p></td>
    116116</tr>
    117117<tr>
     
    130130<?php } else { ?>
    131131<tr>
    132132<th scope="row"><label for="new_admin_email"><?php _e('E-mail Address') ?> </label></th>
    133 <td><input name="new_admin_email" type="text" id="new_admin_email" value="<?php form_option('admin_email'); ?>" class="regular-text ltr" />
     133<td><input name="new_admin_email" type="email" id="new_admin_email" value="<?php form_option( 'admin_email' ); ?>" class="regular-text ltr" />
    134134<p class="description"><?php _e('This address is used for admin purposes. If you change this we will send you an e-mail at your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>') ?></p>
    135135<?php
    136136$new_admin_email = get_option( 'new_admin_email' );
  • src/wp-signup.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    188188        <?php if ( $errmsg = $errors->get_error_message('user_email') ) { ?>
    189189                <p class="error"><?php echo $errmsg ?></p>
    190190        <?php } ?>
    191         <input name="user_email" type="text" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('We send your registration email to this address. (Double-check your email address before continuing.)') ?>
     191        <input name="user_email" type="email" id="user_email" value="<?php  echo esc_attr($user_email) ?>" maxlength="200" /><br /><?php _e('We send your registration email to this address. (Double-check your email address before continuing.)') ?>
    192192        <?php
    193193        if ( $errmsg = $errors->get_error_message('generic') ) {
    194194                echo '<p class="error">' . $errmsg . '</p>';
     
    435435        ?>
    436436
    437437        <h2><?php printf( __( 'Get your own %s account in seconds' ), get_current_site()->site_name ) ?></h2>
    438         <form id="setupform" method="post" action="wp-signup.php">
     438        <form id="setupform" method="post" action="wp-signup.php" novalidate="novalidate">
    439439                <input type="hidden" name="stage" value="validate-user-signup" />
    440440                <?php
    441441                /** This action is documented in wp-signup.php */
  • src/wp-admin/network/settings.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    8585
    8686<div class="wrap">
    8787        <h2><?php echo esc_html( $title ); ?></h2>
    88         <form method="post" action="settings.php">
     88        <form method="post" action="settings.php" novalidate="novalidate">
    8989                <?php wp_nonce_field( 'siteoptions' ); ?>
    9090                <h3><?php _e( 'Operational Settings' ); ?></h3>
    9191                <table class="form-table">
     
    9999                        <tr>
    100100                                <th scope="row"><label for="admin_email"><?php _e( 'Network Admin Email' ) ?></label></th>
    101101                                <td>
    102                                         <input name="admin_email" type="text" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option('admin_email') ) ?>" />
     102                                        <input name="admin_email" type="email" id="admin_email" class="regular-text" value="<?php echo esc_attr( get_site_option( 'admin_email' ) ) ?>" />
    103103                                        <p class="description">
    104104                                                <?php _e( 'This email address will receive notifications. Registration and support emails will also come from this address.' ); ?>
    105105                                        </p>   
  • src/wp-login.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    519519
    520520?>
    521521
    522 <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
     522<form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post" novalidate="novalidate">
    523523        <p>
    524524                <label for="user_login" ><?php _e('Username or E-mail:') ?><br />
    525                 <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label>
     525                <input type="email" name="user_login" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label>
    526526        </p>
    527527        <?php
    528528        /**
     
    680680        login_header(__('Registration Form'), '<p class="message register">' . __('Register For This Site') . '</p>', $errors);
    681681?>
    682682
    683 <form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post">
     683<form name="registerform" id="registerform" action="<?php echo esc_url( site_url('wp-login.php?action=register', 'login_post') ); ?>" method="post" novalidate="novalidate">
    684684        <p>
    685685                <label for="user_login"><?php _e('Username') ?><br />
    686686                <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr(wp_unslash($user_login)); ?>" size="20" /></label>
    687687        </p>
    688688        <p>
    689689                <label for="user_email"><?php _e('E-mail') ?><br />
    690                 <input type="text" name="user_email" id="user_email" class="input" value="<?php echo esc_attr(wp_unslash($user_email)); ?>" size="25" /></label>
     690                <input type="email" name="user_email" id="user_email" class="input" value="<?php echo esc_attr( wp_unslash( $user_email ) ); ?>" size="25" /></label>
    691691        </p>
    692692        <?php
    693693        /**
  • src/wp-admin/network/site-new.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    119119        foreach ( $messages as $msg )
    120120                echo '<div id="message" class="updated"><p>' . $msg . '</p></div>';
    121121} ?>
    122 <form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>">
     122<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
    123123<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
    124124        <table class="form-table">
    125125                <tr class="form-field form-required">
     
    140140                </tr>
    141141                <tr class="form-field form-required">
    142142                        <th scope="row"><?php _e( 'Admin Email' ) ?></th>
    143                         <td><input name="blog[email]" type="text" class="regular-text wp-suggest-user" data-autocomplete-type="search" data-autocomplete-field="user_email" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
     143                        <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" data-autocomplete-type="search" data-autocomplete-field="user_email" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
    144144                </tr>
    145145                <tr class="form-field">
    146146                        <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>