mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 11:55:03 +03:00
Removed posts.tags.parent sanitation
refs #10438 - As we strip parent and parent_id fields in /tags endpoint, similarly stripping it for posts related tags
This commit is contained in:
parent
c58e03a359
commit
921f9d394f
@ -108,25 +108,6 @@ module.exports = {
|
||||
delete frame.data.posts[0].author;
|
||||
}
|
||||
|
||||
/**
|
||||
* Model notation is: `tag.parent_id`.
|
||||
* The API notation is `tag.parent`.
|
||||
*/
|
||||
if (frame.data.posts[0].hasOwnProperty('tags')) {
|
||||
if (_.isArray(frame.data.posts[0].tags) && frame.data.posts[0].tags.length) {
|
||||
_.each(frame.data.posts[0].tags, (tag, index) => {
|
||||
if (tag.hasOwnProperty('parent')) {
|
||||
frame.data.posts[0].tags[index].parent_id = tag.parent;
|
||||
delete frame.data.posts[0].tags[index].parent;
|
||||
}
|
||||
|
||||
if (tag.hasOwnProperty('posts')) {
|
||||
delete frame.data.posts[0].tags[index].posts;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
frame.data.posts[0] = url.forPost(Object.assign({}, frame.data.posts[0]), frame.options);
|
||||
},
|
||||
|
||||
|
@ -174,6 +174,15 @@
|
||||
"slug": {
|
||||
"type": ["string", "null"],
|
||||
"maxLength": 191
|
||||
},
|
||||
"parent": {
|
||||
"strip": true
|
||||
},
|
||||
"parent_id": {
|
||||
"strip": true
|
||||
},
|
||||
"posts": {
|
||||
"strip": true
|
||||
}
|
||||
},
|
||||
"anyOf": [
|
||||
|
Loading…
Reference in New Issue
Block a user