mirror of
https://gitlab.com/Anson-Projects/zine.git
synced 2025-07-27 00:31:23 +00:00
check main_url for validity
This commit is contained in:
@@ -247,7 +247,13 @@ pub fn validate(post: &mut Post) {
|
||||
|
||||
if !is_valid_url(post.link.as_str()) {
|
||||
post.score = 0;
|
||||
println!("{} is not valid", post.link.as_str());
|
||||
println!("post link {} is not valid", post.link.as_str());
|
||||
return;
|
||||
};
|
||||
|
||||
if !is_valid_url(&("http://".to_owned() + post.main_url.as_str())) {
|
||||
post.score = 0;
|
||||
println!("main_url {} is not valid", post.main_url.as_str());
|
||||
return;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user