fix(blog-preview.php): click readmore will lead to 404 page

On Blog Preview page when someone set readmore flag will make rest of the content invisible.
Instead there will be a button for users to click and get the full article.
Because of the wrongly put link, it will make the last slash missing.
Put the blog id back in the right place to get a right link.
This commit is contained in:
EarringYYR 2019-02-20 19:02:08 +08:00 committed by Masco Skray
parent 46aa7b7005
commit a604bf9476

View File

@ -2,7 +2,7 @@
if ($is_preview) {
$readmore_pos = strpos($blog['content'], '<!-- readmore -->');
if ($readmore_pos !== false) {
$content = substr($blog['content'], 0, $readmore_pos).'<p><a href="'.HTML::blog_url(UOJContext::userid(), '/blog/').$blog['id'].'">阅读更多……</a></p>';
$content = substr($blog['content'], 0, $readmore_pos).'<p><a href="'.HTML::blog_url(UOJContext::userid(), '/blog/'.$blog['id']).'">阅读更多……</a></p>';
} else {
$content = $blog['content'];
}