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

Aylwin Cal aylwin.cal at gmail.com
Mon Jan 30 07:23:04 GMT 2006


At around line 1660 in classes.php, we have this function:

    function handle_404() {
        global $wp_query;
        // Issue a 404 if a permalink request doesn't match any posts.
Don't
        // issue a 404 if one was already issued, if the request was a
search,
        // or if the request was a regular query string request rather than
a
        // permalink request.
        if ( (0 == count($wp_query->posts)) && !is_404() && !is_category()
&& !is_search() && ( $this->did_permalink ||
(!empty($_SERVER['QUERY_STRING']) && (false ===
strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
            $wp_query->set_404();
            status_header( 404 );
        }    elseif( is_404() != true ) {
            status_header( 200 );
        }
    }

The question is, why do we need this:

        elseif( is_404() != true ) {
            status_header( 200 );
        }

If it's not essential, can we do without it? This block of code causes
problems when integrating WP 2.0/2.0.1 with Gallery 2/2.1.  It has to with
the breadcrumb trails and redirects in Gallery.  Instead of redirecting to
the correct page, we get stuck with a 200 OK page.  Commenting out the above
code fixes this problem.  We haven't noticed any negative side effects yet
so I was wondering  if this code is really necessary.

Thanks,
Aylwin


More information about the wp-testers mailing list