Fix over-aggressive form validation. Props mdawaffe. fixes #6209
git-svn-id: https://develop.svn.wordpress.org/trunk@7384 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5390765e9d
commit
000eee5dab
@ -2,14 +2,14 @@
|
|||||||
if ( ! empty($cat_ID) ) {
|
if ( ! empty($cat_ID) ) {
|
||||||
$heading = __('Edit Category');
|
$heading = __('Edit Category');
|
||||||
$submit_text = __('Edit Category');
|
$submit_text = __('Edit Category');
|
||||||
$form = '<form name="editcat" id="editcat" method="post" action="categories.php">';
|
$form = '<form name="editcat" id="editcat" method="post" action="categories.php" class="validate">';
|
||||||
$action = 'editedcat';
|
$action = 'editedcat';
|
||||||
$nonce_action = 'update-category_' . $cat_ID;
|
$nonce_action = 'update-category_' . $cat_ID;
|
||||||
do_action('edit_category_form_pre', $category);
|
do_action('edit_category_form_pre', $category);
|
||||||
} else {
|
} else {
|
||||||
$heading = __('Add Category');
|
$heading = __('Add Category');
|
||||||
$submit_text = __('Add Category');
|
$submit_text = __('Add Category');
|
||||||
$form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list:">';
|
$form = '<form name="addcat" id="addcat" method="post" action="categories.php" class="add:the-list: validate">';
|
||||||
$action = 'addcat';
|
$action = 'addcat';
|
||||||
$nonce_action = 'add-category';
|
$nonce_action = 'add-category';
|
||||||
do_action('add_category_form_pre', $category);
|
do_action('add_category_form_pre', $category);
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
if ( ! empty($cat_ID) ) {
|
if ( ! empty($cat_ID) ) {
|
||||||
$heading = __('Edit Category');
|
$heading = __('Edit Category');
|
||||||
$submit_text = __('Edit Category');
|
$submit_text = __('Edit Category');
|
||||||
$form = '<form name="editcat" id="editcat" method="post" action="link-category.php">';
|
$form = '<form name="editcat" id="editcat" method="post" action="link-category.php" class="validate">';
|
||||||
$action = 'editedcat';
|
$action = 'editedcat';
|
||||||
$nonce_action = 'update-link-category_' . $cat_ID;
|
$nonce_action = 'update-link-category_' . $cat_ID;
|
||||||
do_action('edit_link_category_form_pre', $category);
|
do_action('edit_link_category_form_pre', $category);
|
||||||
} else {
|
} else {
|
||||||
$heading = __('Add Category');
|
$heading = __('Add Category');
|
||||||
$submit_text = __('Add Category');
|
$submit_text = __('Add Category');
|
||||||
$form = '<form name="addcat" id="addcat" class="add:the-list:" method="post" action="link-category.php">';
|
$form = '<form name="addcat" id="addcat" class="add:the-list: validate" method="post" action="link-category.php">';
|
||||||
$action = 'addcat';
|
$action = 'addcat';
|
||||||
$nonce_action = 'add-link-category';
|
$nonce_action = 'add-link-category';
|
||||||
do_action('add_link_category_form_pre', $category);
|
do_action('add_link_category_form_pre', $category);
|
||||||
|
@ -2,12 +2,12 @@
|
|||||||
if ( ! empty($link_id) ) {
|
if ( ! empty($link_id) ) {
|
||||||
$heading = __('Edit Link');
|
$heading = __('Edit Link');
|
||||||
$submit_text = __('Save Changes');
|
$submit_text = __('Save Changes');
|
||||||
$form = '<form name="editlink" id="editlink" method="post" action="link.php">';
|
$form = '<form name="editlink" id="editlink" method="post" action="link.php" class="validate">';
|
||||||
$nonce_action = 'update-bookmark_' . $link_id;
|
$nonce_action = 'update-bookmark_' . $link_id;
|
||||||
} else {
|
} else {
|
||||||
$heading = __('Add Link');
|
$heading = __('Add Link');
|
||||||
$submit_text = __('Add Link');
|
$submit_text = __('Add Link');
|
||||||
$form = '<form name="addlink" id="addlink" method="post" action="link.php">';
|
$form = '<form name="addlink" id="addlink" method="post" action="link.php" class="validate">';
|
||||||
$nonce_action = 'add-bookmark';
|
$nonce_action = 'add-bookmark';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2,14 +2,14 @@
|
|||||||
if ( ! empty($tag_ID) ) {
|
if ( ! empty($tag_ID) ) {
|
||||||
$heading = __('Edit Tag');
|
$heading = __('Edit Tag');
|
||||||
$submit_text = __('Edit Tag');
|
$submit_text = __('Edit Tag');
|
||||||
$form = '<form name="edittag" id="edittag" method="post" action="edit-tags.php">';
|
$form = '<form name="edittag" id="edittag" method="post" action="edit-tags.php" class="validate">';
|
||||||
$action = 'editedtag';
|
$action = 'editedtag';
|
||||||
$nonce_action = 'update-tag_' . $tag_ID;
|
$nonce_action = 'update-tag_' . $tag_ID;
|
||||||
do_action('edit_tag_form_pre', $tag);
|
do_action('edit_tag_form_pre', $tag);
|
||||||
} else {
|
} else {
|
||||||
$heading = __('Add Tag');
|
$heading = __('Add Tag');
|
||||||
$submit_text = __('Add Tag');
|
$submit_text = __('Add Tag');
|
||||||
$form = '<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list:">';
|
$form = '<form name="addtag" id="addtag" method="post" action="edit-tags.php" class="add:the-list: validate">';
|
||||||
$action = 'addtag';
|
$action = 'addtag';
|
||||||
$nonce_action = 'add-tag';
|
$nonce_action = 'add-tag';
|
||||||
do_action('add_tag_form_pre', $tag);
|
do_action('add_tag_form_pre', $tag);
|
||||||
|
@ -848,7 +848,7 @@ function media_upload_type_form($type = 'file', $errors = null, $id = null) {
|
|||||||
$callback = "type_form_$type";
|
$callback = "type_form_$type";
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form type-form" id="<?php echo $type; ?>-form">
|
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form type-form validate" id="<?php echo $type; ?>-form">
|
||||||
<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
|
<input type="hidden" name="post_id" id="post_id" value="<?php echo $post_id; ?>" />
|
||||||
<?php wp_nonce_field('media-form'); ?>
|
<?php wp_nonce_field('media-form'); ?>
|
||||||
<h3><?php _e('From Computer'); ?></h3>
|
<h3><?php _e('From Computer'); ?></h3>
|
||||||
@ -909,7 +909,7 @@ jQuery(function($){
|
|||||||
-->
|
-->
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form" id="gallery-form">
|
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="gallery-form">
|
||||||
<?php wp_nonce_field('media-form'); ?>
|
<?php wp_nonce_field('media-form'); ?>
|
||||||
<?php //media_upload_form( $errors ); ?>
|
<?php //media_upload_form( $errors ); ?>
|
||||||
|
|
||||||
@ -1044,7 +1044,7 @@ foreach ($arc_result as $arc_row) {
|
|||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form" id="library-form">
|
<form enctype="multipart/form-data" method="post" action="<?php echo attribute_escape($form_action_url); ?>" class="media-upload-form validate" id="library-form">
|
||||||
|
|
||||||
<?php wp_nonce_field('media-form'); ?>
|
<?php wp_nonce_field('media-form'); ?>
|
||||||
<?php //media_upload_form( $errors ); ?>
|
<?php //media_upload_form( $errors ); ?>
|
||||||
|
@ -7,7 +7,7 @@ jQuery(document).ready( function() {
|
|||||||
|
|
||||||
// Basic form validation
|
// Basic form validation
|
||||||
if ( ( 'undefined' != typeof wpAjax ) && jQuery.isFunction( wpAjax.validateForm ) ) {
|
if ( ( 'undefined' != typeof wpAjax ) && jQuery.isFunction( wpAjax.validateForm ) ) {
|
||||||
jQuery('form').submit( function() { return wpAjax.validateForm( jQuery(this) ); } );
|
jQuery('form.validate').submit( function() { return wpAjax.validateForm( jQuery(this) ); } );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -398,7 +398,7 @@ foreach ( $wp_user_search->get_results() as $userid ) {
|
|||||||
else
|
else
|
||||||
echo '<p>' . sprintf(__('Users cannot currently <a href="%1$s">register themselves</a>, but you can manually create users here.'), get_option('siteurl').'/wp-admin/options-general.php#users_can_register') . '</p>';
|
echo '<p>' . sprintf(__('Users cannot currently <a href="%1$s">register themselves</a>, but you can manually create users here.'), get_option('siteurl').'/wp-admin/options-general.php#users_can_register') . '</p>';
|
||||||
?>
|
?>
|
||||||
<form action="#add-new-user" method="post" name="adduser" id="adduser" class="add:users:">
|
<form action="#add-new-user" method="post" name="adduser" id="adduser" class="add:users: validate">
|
||||||
<?php wp_nonce_field('add-user') ?>
|
<?php wp_nonce_field('add-user') ?>
|
||||||
<table class="form-table">
|
<table class="form-table">
|
||||||
<tr class="form-field form-required">
|
<tr class="form-field form-required">
|
||||||
|
@ -11,7 +11,7 @@ class WP_Scripts {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function default_scripts() {
|
function default_scripts() {
|
||||||
$this->add( 'common', '/wp-admin/js/common.js', array('jquery'), '1.0' );
|
$this->add( 'common', '/wp-admin/js/common.js', array('jquery'), '20080318' );
|
||||||
$this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
|
$this->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
|
||||||
|
|
||||||
$this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
|
$this->add( 'quicktags', '/wp-includes/js/quicktags.js', false, '3958' );
|
||||||
|
Loading…
Reference in New Issue
Block a user