Fix page 404 when page_for_posts is empty. see #6539

git-svn-id: https://develop.svn.wordpress.org/trunk@7905 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-05-07 19:57:15 +00:00
parent 007689ab77
commit b288e5a8af
1 changed files with 2 additions and 1 deletions

View File

@ -923,7 +923,8 @@ class WP_Query {
$reqpage = 0;
}
if ( ('page' != get_option('show_on_front') ) || ( $reqpage != get_option('page_for_posts') ) ) {
$page_for_posts = get_option('page_for_posts');
if ( ('page' != get_option('show_on_front') ) || empty($page_for_posts) || ( $reqpage != $page_for_posts ) ) {
$q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));
$page_paths = '/' . trim($q['pagename'], '/');
$q['pagename'] = sanitize_title(basename($page_paths));