Skip to:
Content

BuddyPress.org

Opened 7 years ago

Closed 7 years ago

#7684 closed enhancement (fixed)

Use bp_is_post_request() instead of hardcoding the POST verification

Reported by: espellcaste's profile espellcaste Owned by: espellcaste's profile espellcaste
Milestone: 3.0 Priority: normal
Severity: normal Version:
Component: Core Keywords: has-patch commit
Cc:

Description

BuddyPress has a helper function that check if a request is a POST request. bp_is_post_request().

The strange part is that this helper function is not being used in several areas where the POST verification is done.

I'm not sure why. So I updated the places to use it both in core, BP Legacy and in some files, in Noveau.

Attachments (1)

7684-1.diff (16.2 KB) - added by espellcaste 7 years ago.

Download all attachments as: .zip

Change History (5)

@espellcaste
7 years ago

#1 @DJPaul
7 years ago

This patch is good.

@espellcaste As I said in chat the other day, please write a commit message so we can check it before you commit the change. Thank you.

#2 @espellcaste
7 years ago

Hi @DJPaul! Here it is:

Make use of bp_is_post_request() instead of hardcoding POST verifications directly.

BuddyPress is not making use of the bp_is_post_request() in several ajax scenarios to confirm if the post request is indeed a POST request. Instead, it is hardcoding the check directly. This change updates those places making use of this function.

#3 @DJPaul
7 years ago

  • Keywords commit added

Looks good - go for it!

Remember to add "Fixes #7684" to the end.

#4 @espellcaste
7 years ago

  • Owner set to espellcaste
  • Resolution set to fixed
  • Status changed from new to closed

In 11858:

Make use of bp_is_post_request() instead of hardcoding POST verifications directly.

BuddyPress is not making use of the bp_is_post_request() in several ajax scenarios to confirm if the post request is indeed a POST request. Instead, it is hardcoding the check directly. This change updates those places making use of this function.

Props DjPaul

Fixes #7684

Note: See TracTickets for help on using tickets.