Browse Source

Bugfix: empty desciption

pull/99/head
Kanti 11 years ago
parent
commit
7601aaeffa
1 changed files with 10 additions and 5 deletions
  1. +10
    -5
      system/includes/functions.php

+ 10
- 5
system/includes/functions.php View File

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


Loading…
Cancel
Save