WordPress.org

Make WordPress Core

Opened 9 years ago

Closed 7 years ago

#1341 closed defect (bug) (worksforme)

<!--nextpage--> navigation on permalinks with no trailing slash fails

Reported by: Joen Owned by: ryan
Milestone: Priority: normal
Severity: minor Version: 1.5.1.1
Component: General Keywords: nextpage
Focuses: Cc:

Description

When using rewritten permalinks with no trailing slashes, for instance
/%year%/%monthnum%/%postname%
Paged post navigation fails working.

Quite simply, what should have been
/%year%/%monthnum%/%postname%/2/
ends being
/%year%/%monthnum%/%postname%2/

Note: /%year%/%monthnum%/%postname%/2/ will still work, but the paged navigation won't link to this.

Attachments (1)

link_pages.diff (639 bytes) - added by Joen 9 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Joen9 years ago

  • Patch set to No

comment:2 twistedraisin9 years ago

--- template-functions-links.php (revision 2597)
+++ template-functions-links.php (working copy)
@@ -44,6 +44,9 @@

$permalink = get_settings('permalink_structure');

+ if (!preg_match('/\/$/',$permalink))
+ $permalink .= "/";
+

if ( != $permalink && 'draft' != $post->post_status) {

$unixtime = strtotime($post->post_date);

@@ -489,4 +492,4 @@

}

}

-?>
\ No newline at end of file
+?>

comment:3 ryan9 years ago

  • Owner changed from anonymous to rboren
  • Status changed from new to assigned

comment:4 matt9 years ago

  • fixed_in_version set to 1.5.1.1
  • Resolution changed from 10 to 20
  • Status changed from assigned to closed

Joen9 years ago

comment:5 Joen9 years ago

  • Component changed from Administration to General
  • Keywords nextpage added
  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Version changed from 1.5.1 to 1.5.1.1

Kudos on fixing it, but there's still a problem.

When using wp_link_pages in the following way:

<?php wp_link_pages('before=<p>&after=</p>&next_or_number=number&pagelink=%'); ?>

the problem re-appears. The "Next" link will link to /%postname%2/ rather than /%postname%/2/

comment:6 rob1n7 years ago

  • Cc twistedraisin removed
  • Resolution set to worksforme
  • Status changed from reopened to closed

Worksforme.

Note: See TracTickets for help on using tickets.