mirror of https://github.com/halo-dev/halo
Replace post url with title if absent
parent
a2d4991e42
commit
aa398b2525
|
@ -62,13 +62,9 @@ public class PostParam implements InputConverter<Post> {
|
|||
@Override
|
||||
public Post convertTo() {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
url = HaloUtils.normalizeUrl(title);
|
||||
} else {
|
||||
url = HaloUtils.normalizeUrl(url);
|
||||
url = title;
|
||||
}
|
||||
|
||||
url = HaloUtils.initializeUrlIfBlank(url);
|
||||
|
||||
Post post = InputConverter.super.convertTo();
|
||||
// Crypt password
|
||||
if (StringUtils.isNotBlank(password)) {
|
||||
|
@ -81,13 +77,9 @@ public class PostParam implements InputConverter<Post> {
|
|||
@Override
|
||||
public void update(Post post) {
|
||||
if (StringUtils.isBlank(url)) {
|
||||
url = HaloUtils.normalizeUrl(title);
|
||||
} else {
|
||||
url = HaloUtils.normalizeUrl(url);
|
||||
url = title;
|
||||
}
|
||||
|
||||
url = HaloUtils.initializeUrlIfBlank(url);
|
||||
|
||||
InputConverter.super.update(post);
|
||||
|
||||
// Crypt password
|
||||
|
|
Loading…
Reference in New Issue