WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#24969 closed defect (bug) (fixed)

wp_redirect must return true

Reported by: tivnet Owned by: ryan
Milestone: 3.7 Priority: normal
Severity: trivial Version: 2.1
Component: General Keywords: has-patch commit
Focuses: Cc:

Description

A code like this one

if(wp_redirect('/', 301)){
	error_log('redirected');
}

won't work because in the case of success, wp_redirect returns NULL, while it must return a boolean value (true if all was OK)

Attachments (1)

pluggable.php.patch (345 bytes) - added by tivnet 8 years ago.

Download all attachments as: .zip

Change History (4)

#1 @rmccue
8 years ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 3.7
  • Version changed from trunk to 2.1

Broken since r4407

#2 @ryan
8 years ago

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

In 24996:

Return true from wp_redirect() when redirect successful. Update phpdoc.

Props tivnet
fixes #24969

#3 @c3mdigital
8 years ago

#17472 was marked as a duplicate.

Note: See TracTickets for help on using tickets.