Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Give each attribute in Edit Flow settings page a different id #650

Merged
merged 1 commit into from
May 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/settings/lib/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jQuery(document).ready(function(){
var module_action = 'disable';

var slug = jQuery(this).closest('.edit-flow-module').attr('id');
var change_module_nonce = jQuery('#' + slug + ' #change-module-nonce').val();
var change_module_nonce = jQuery('#' + slug + ' #change-module-nonce-' + slug).val();
var data = {
action: 'change_edit_flow_module_state',
module_action: module_action,
Expand Down
2 changes: 1 addition & 1 deletion modules/settings/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ function print_modules() {
if ( $mod_data->options->enabled == 'off' ) echo ' style="display:none;"';
echo ' value="' . __( 'Disable', 'edit-flow' ) . '" />';
echo '</p>';
wp_nonce_field( 'change-edit-flow-module-nonce', 'change-module-nonce', false );
wp_nonce_field( 'change-edit-flow-module-nonce', 'change-module-nonce-' . $mod_data->slug, false );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this name change mean for validating the nonce?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nm, I see the nonce doesn't change based on name.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nm, I see the nonce doesn't change based on name.

Yeah, that's right. The change-edit-flow-module-nonce action for wp_nonce_field and wp_verify_nonce is still the same.

echo '</form>';
echo '</div>';
}
Expand Down