change post.content and comment.content's types from String to SafeString

This commit is contained in:
Trinity Pointard
2018-06-11 12:21:34 +02:00
committed by Your Name
parent bb1442db8a
commit 7d9609671c
8 changed files with 148 additions and 8 deletions
+2 -1
View File
@@ -15,6 +15,7 @@ use models::{
users::User
};
use utils;
use safe_string::SafeString;
#[get("/~/<blog>/<slug>", rank = 4)]
fn details(blog: String, slug: String, conn: DbConn, user: Option<User>) -> Template {
@@ -100,7 +101,7 @@ fn create(blog_name: String, data: Form<NewPostForm>, user: User, conn: DbConn)
blog_id: blog.id,
slug: slug.to_string(),
title: form.title.to_string(),
content: content,
content: SafeString::new(&content),
published: true,
license: form.license.to_string(),
ap_url: "".to_string()