Bugs fixed for new created blog

This commit is contained in:
danpros 2021-03-12 08:04:08 +07:00
commit 5a924e9164

View file

@ -88,7 +88,9 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $
$tag = explode(',', preg_replace("/\s*,\s*/", ",", rtrim($tag, ',')));
$tag = array_filter(array_unique($tag));
$taglang = array_flip(unserialize(file_get_contents('content/data/tags.lang')));
$tagslang = "content/data/tags.lang";
if (file_exists($tagslang)) {
$taglang = array_flip(unserialize(file_get_contents($tagslang)));
$tflip = array_intersect_key($taglang, array_flip($tag));
$post_tag = array();
$post_tagmd = array();
@ -109,6 +111,11 @@ function add_content($title, $tag, $url, $content, $user, $description = null, $
$post_tag = safe_tag(implode(',', $post_tag));
$post_tagmd = safe_html(implode(',', $post_tagmd));
} else {
$post_tag = safe_tag(implode(',', $tag));
$post_tagmd = safe_html(implode(',', $tag));
}
$post_date = date('Y-m-d-H-i-s');
$post_title = safe_html($title);
$post_media = preg_replace('/\s\s+/', ' ', strip_tags($media));