mirror of
https://github.com/danpros/htmly.git
synced 2026-04-23 05:56:22 +05:30
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.
This commit is contained in:
parent
a4513058eb
commit
f5436d446c
1 changed files with 1 additions and 1 deletions
|
|
@ -386,7 +386,7 @@ function find_post($year, $month, $name)
|
|||
|
||||
foreach ($posts as $index => $v) {
|
||||
$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
|
||||
// a properly parsed object
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue