Browse Source

If there was two blog entries with the same permalink but different dates, `find_post` always returned the latest one and ignored year/month. Fixed by checking that `$year` is actually set to NULL, which is the case if you use the post/title permalink type.

pull/430/head
Stefan Björk 4 years ago
parent
commit
f5436d446c
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      system/includes/functions.php

+ 1
- 1
system/includes/functions.php View File

@ -386,7 +386,7 @@ function find_post($year, $month, $name)
foreach ($posts as $index => $v) { foreach ($posts as $index => $v) {
$arr = explode('_', $v['basename']); $arr = explode('_', $v['basename']);
if (strpos($arr[0], "$year-$month") !== false && strtolower($arr[2]) === strtolower($name . '.md') || strtolower($arr[2]) === strtolower($name . '.md')) {
if ((strpos($arr[0], "$year-$month") !== false && strtolower($arr[2]) === strtolower($name . '.md')) || ($year === NULL && strtolower($arr[2]) === strtolower($name . '.md'))) {
// Use the get_posts method to return // Use the get_posts method to return
// a properly parsed object // a properly parsed object


Loading…
Cancel
Save