WordPress.org

Make WordPress Core

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4249 closed defect (bug) (fixed)

5446 mucks things up a bit

Reported by: masquerade Owned by: rob1n
Milestone: 2.3 Priority: normal
Severity: blocker Version: 2.2
Component: General Keywords:
Focuses: Cc:

Description

You can't call a function before it is defined, namely status_header(). Will create fatal errors.

Change History (7)

comment:1 @rob1n8 years ago

  • Milestone changed from 2.2 to 2.3
  • Status changed from new to assigned

I believe you mean in wpdb::bail()? I'll add a function_exists() call, since the 503 header isn't essential.

comment:2 @rob1n8 years ago

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [5455]) Don't call the function if it doesn't exist yet. fixes #4249

comment:3 @masquerade8 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

Bail is called only when we can't connect at all. That function will _never_ be defined when that's called. Its dead code, either the function needs to be moved or it should be axed altogether.

comment:4 @matt8 years ago

Agreed.

comment:5 @rob1n8 years ago

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [5458]) Don't make useless status_header() call. fixes #4249

comment:6 @matt8 years ago

What about moving the function further up in the includes, maybe even in wpdb?

comment:7 @masquerade8 years ago

We've had issues like this before with functions in wpdb. I'd prefer not to see functions that aren't directly associated with the db in the db file, but perhaps we can move some of these essential functions to an essential.php or somesuch.

Note: See TracTickets for help on using tickets.