Fix page 404 when page_for_posts is empty. see #6539

git-svn-id: http://svn.automattic.com/wordpress/trunk@7905 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2008-05-07 19:57:15 +00:00
parent d8ee8494be
commit c25a6fe381
1 changed files with 2 additions and 1 deletions

View File

@ -923,7 +923,8 @@ class WP_Query {
$reqpage = 0; $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']))); $q['pagename'] = str_replace('%2F', '/', urlencode(urldecode($q['pagename'])));
$page_paths = '/' . trim($q['pagename'], '/'); $page_paths = '/' . trim($q['pagename'], '/');
$q['pagename'] = sanitize_title(basename($page_paths)); $q['pagename'] = sanitize_title(basename($page_paths));