Merge pull request #99 from Kanti/master

Bug-fix: empty description by @Kanti.
This commit is contained in:
Danang Probo Sayekti 2014-09-23 15:45:33 +07:00
commit 3a3eb8b29c

View file

@ -238,13 +238,14 @@ function get_posts($posts, $page = 1, $perpage = 0) {
$post->tagb = implode(' » ', $bc);
$post->file = $filepath;
// Get the contents and convert it to HTML
$content = MarkdownExtra::defaultTransform(file_get_contents($filepath));
$content = file_get_contents($filepath);
// Extract the title and body
$post->title = get_content_tag('t', $content, 'Untitled: ' . date('l jS \of F Y', $post->date));
$post->body = remove_html_comments($content);
// Get the contents and convert it to HTML
$post->body = MarkdownExtra::defaultTransform(remove_html_comments($content));
if (config("views.counter")) {
$post->views = get_views($post->file);
@ -1711,7 +1712,11 @@ function get_content_tag($tag, $string, $alt = null) {
$ary = array();
if (preg_match($reg, $string, $ary)) {
if (isset($ary[1])) {
return trim($ary[1]);
$result = trim($ary[1]);
if(!empty($result))
{
return $result;
}
}
}
return $alt;