[wp-testers] Can we delete this code from classes.php?

Andy Skelton skeltoac at gmail.com
Wed Feb 1 23:05:49 GMT 2006


On 2/1/06, Kirk Steffensen <blogger at steffensenfamily.com> wrote:
> The bottom line is that WPG2 cannot call get_header() and get_footer() without
> requiring wp-blog-header.php.

I think this statement is too broad. If you need part of wp() but not
the rest, you can call the needed functions individually. Still, this
isn't optimal.

> So that brings us back to the original question of "What is the purpose of
> forcing the 200 HTTP status code at the end of classes.php."

`svn blame` reports that Ryan commited the latest patch to that line
of code, a patch written by Donncha.

Whatever was causing the bad 404's to bubble up, which led to the
elseif statement you dislike, has managed to evade all eyes so far.
Most of us cannot replicate the issue, so someone who can must come
forward if we're to fix that more properly.

> It seems like the cleanest way is to capture the HTTP status code of the
> originating message and spit it back out at the elseif.  Although I think this
> is the same as just eliminating the elseif, since if you never override the
> status code, it should stay where it was.  (Unless that is the problem
> that the
> elseif was intended to solve in some specific server setups.)

I still think this isn't the right target. A call to header('Location:
<url>') should set the status code to 302 unless it was set by a
previous header() call, in which case an additional header() call is
required to specify the 302 status code. So either Gallery is setting
the Location header and neglecting to set the status code, or Gallery
is setting both and PHP is screwing up on your setup.

Do you want to trace the code through Gallery to find where the
Location header is being set?

Andy


More information about the wp-testers mailing list