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
|
@Override
|
||||||
public Post convertTo() {
|
public Post convertTo() {
|
||||||
if (StringUtils.isBlank(url)) {
|
if (StringUtils.isBlank(url)) {
|
||||||
url = HaloUtils.normalizeUrl(title);
|
url = title;
|
||||||
} else {
|
|
||||||
url = HaloUtils.normalizeUrl(url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
url = HaloUtils.initializeUrlIfBlank(url);
|
|
||||||
|
|
||||||
Post post = InputConverter.super.convertTo();
|
Post post = InputConverter.super.convertTo();
|
||||||
// Crypt password
|
// Crypt password
|
||||||
if (StringUtils.isNotBlank(password)) {
|
if (StringUtils.isNotBlank(password)) {
|
||||||
|
@ -81,13 +77,9 @@ public class PostParam implements InputConverter<Post> {
|
||||||
@Override
|
@Override
|
||||||
public void update(Post post) {
|
public void update(Post post) {
|
||||||
if (StringUtils.isBlank(url)) {
|
if (StringUtils.isBlank(url)) {
|
||||||
url = HaloUtils.normalizeUrl(title);
|
url = title;
|
||||||
} else {
|
|
||||||
url = HaloUtils.normalizeUrl(url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
url = HaloUtils.initializeUrlIfBlank(url);
|
|
||||||
|
|
||||||
InputConverter.super.update(post);
|
InputConverter.super.update(post);
|
||||||
|
|
||||||
// Crypt password
|
// Crypt password
|
||||||
|
|
Loading…
Reference in New Issue