Make WordPress Core

Opened 10 years ago

Last modified 10 years ago

#27498 closed defect (bug)

Canonical redirect is applied upon POST request — at Version 1

Reported by: caxelsson's profile c.axelsson Owned by:
Milestone: 4.0 Priority: normal
Severity: normal Version: 3.1
Component: Canonical Keywords: has-patch 4.0-early
Focuses: Cc:

Description (last modified by SergeyBiryukov)

If $_POST is empty a canonical redirect is still made even though it should be ignored upon all POST requests. As this redirect occurs before user have a chance to handle the request themselves in a template_redirect filter it prevents users to write proper REST APIs that include POST requests with no data.

A patch that uses $_SERVER['REQUEST_METHOD'] instead of relying on the $_POST variable to identify request type is attached.

Change History (2)

#1 @SergeyBiryukov
10 years ago

  • Description modified (diff)
  • Version changed from trunk to 3.1

Introduced in [5978], modified in [16797].

Last edited 10 years ago by SergeyBiryukov (previous) (diff)
Note: See TracTickets for help on using tickets.