mirror of
https://gitlab.com/Anson-Projects/zine.git
synced 2025-06-15 21:26:38 +00:00
check main_url for validity
This commit is contained in:
parent
310f3d7f6a
commit
015a1a7f19
@ -247,7 +247,13 @@ pub fn validate(post: &mut Post) {
|
|||||||
|
|
||||||
if !is_valid_url(post.link.as_str()) {
|
if !is_valid_url(post.link.as_str()) {
|
||||||
post.score = 0;
|
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;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user