Make WordPress Core

Changeset 3108


Ignore:
Timestamp:
11/16/2005 10:16:20 AM (21 years ago)
Author:
ryan
Message:

Fix 404s. Props donncha. fixes #1471

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/classes.php

    r3097 r3108  
    14891489                    }
    14901490                }
     1491
     1492                // If req_uri is empty, the home page was requested.  Unset error.
     1493                if ( empty($req_uri) ) {
     1494                    if (isset($_GET['error'])) {
     1495                        unset($_GET['error']);
     1496                    }
     1497
     1498                    if (isset($error)) {
     1499                        unset($error);
     1500                    }
     1501                }
    14911502            }
    14921503        }
     
    15091520                $this->query_vars[$wpvar] = '';
    15101521        }
     1522
     1523        if ( isset($error) )
     1524            $this->query_vars['error'] = $error;
    15111525    }
    15121526
     
    16031617        // or if the request was a regular query string request rather than a
    16041618        // permalink request.
    1605         if ( (0 == count($wp_query->posts)) && !is_404() && !is_search()
    1606                  && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) &&
    1607                                                                     (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
     1619        if ( (0 == count($wp_query->posts)) && !is_404() && !is_search() && ( $this->did_permalink || (!empty($_SERVER['QUERY_STRING']) && (false === strpos($_SERVER['REQUEST_URI'], '?'))) ) ) {
    16081620            $wp_query->set_404();
    16091621            status_header( 404 );
    1610         }   else {
     1622        }   elseif( is_404() != true ) {
    16111623            status_header( 200 );
    16121624        }
Note: See TracChangeset for help on using the changeset viewer.